Comment #0 by andrej.mitrovich — 2013-10-05T17:13:31Z
-----
void func(string func = __FUNCTION__)()
{
// oops, 'func' is also the name of the function
pragma(msg, func);
}
void test()
{
func();
}
-----
This makes the compiler start consuming memory without stopping.
The below however is diagnosed properly:
----
void func(string func = "a")()
{
// oops, 'func' is also the name of the function
pragma(msg, func);
}
void test()
{
func();
}
----
test.d(3): Error: function b.func!"a".func circular dependency. Functions cannot be interpreted while being compiled
test.d(6): called from here: func()
test.d(6): while evaluating pragma(msg, func)
Comment #1 by robert.schadek — 2024-12-13T18:12:20Z