mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
18 lines
542 B
D
18 lines
542 B
D
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
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 `()`
|
|
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);
|
|
}
|