[Issue 21681] Can't deduce recursive template function attributes

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 6 05:58:35 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=21681

--- Comment #1 from Илья Ярошенко <ilyayaroshenko at gmail.com> ---
Reduced example:
void foo()(int a)
{
    if (--a)
        bar(a);
}

void bar()(int a)
{
    if (--a)
        foo(a);
}

void main() @safe pure nothrow @nogc
{
    bar(10);
}

==============
onlineapp.d(15): Error: pure function D main cannot call impure function
onlineapp.bar!().bar
onlineapp.d(15): Error: @safe function D main cannot call @system function
onlineapp.bar!().bar
onlineapp.d(7):        onlineapp.bar!().bar is declared here
onlineapp.d(15): Error: @nogc function D main cannot call non- at nogc function
onlineapp.bar!().bar
onlineapp.d(15): Error: function onlineapp.bar!().bar is not nothrow
onlineapp.d(13): Error: nothrow function D main may throw

--


More information about the Digitalmars-d-bugs mailing list