| 1 |
/* |
| 2 |
TEST_OUTPUT: |
| 3 |
--- |
| 4 |
fail_compilation/ice10922.d(11): Error: function `(in uint n) { enum self = __lambda_L10_C12; return n < 2 ? n : self(n - 1) + ...` is not callable using argument types `()` |
| 5 |
fail_compilation/ice10922.d(11): too few arguments, expected 1, got 0 |
| 6 |
fail_compilation/ice10922.d(10): `ice10922.__lambda_L10_C12(in uint n)` declared here |
| 7 |
--- |
| 8 |
*/ |
| 9 |
|
| 10 |
auto fib = (in uint n) pure nothrow { |
| 11 |
enum self = __traits(parent, {}); |
| 12 |
return (n < 2) ? n : self(n - 1) + self(n - 2); |
| 13 |
}; |
| 14 |
|
| 15 |
void main() |
| 16 |
{ |
| 17 |
auto n = fib(39); |
| 18 |
} |