mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 05:00:16 +03:00

* Fix 23722 - Lambdas are mangled incorrectly when using multiple compilation units, resulting in incorrect code * Update test cases
18 lines
478 B
D
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);
|
|
}
|