dmd/compiler/test/fail_compilation/ice10922.d
Dennis a3abf1187e
Fix 23722 - Lambdas are mangled incorrectly when using multiple compi… (#15343)
* Fix 23722 - Lambdas are mangled incorrectly when using multiple compilation units, resulting in incorrect code

* Update test cases
2024-11-27 12:03:16 +01:00

18 lines
478 B
D

/*
TEST_OUTPUT:
---
fail_compilation/ice10922.d(11): Error: function `__lambda_L10_C12` is not callable using argument types `()`
fail_compilation/ice10922.d(11): too few arguments, expected 1, got 0
fail_compilation/ice10922.d(10): `ice10922.__lambda_L10_C12(in uint n)` declared here
---
*/
auto fib = (in uint n) pure nothrow {
enum self = __traits(parent, {});
return (n < 2) ? n : self(n - 1) + self(n - 2);
};
void main()
{
auto n = fib(39);
}