Thread overview
[Issue 10708] Class members as template alias parameters not CTFE-able
Feb 15, 2016
Martin Krejcirik
Dec 17, 2022
Iain Buclaw
February 15, 2016
https://issues.dlang.org/show_bug.cgi?id=10708

--- Comment #2 from Martin Krejcirik <mk@krej.cz> ---
Same issue ? static on templated function helps too.

------------------------------------------
int func(T...)()
{
    return 1;
}

class Bug
{
    Stru s;

    this() { }

    int pokus()
    {
        // Error: this for func needs to be type Stru not type strubug.Bug
        return func!(s.a)();
    }
}

void bug()
{
    Stru s;

    int pokus()
    {
        // Error: need 'this' for 'func' of type 'pure nothrow @nogc @safe
int()'
        return func!(s.a)();
    }
}


struct Stru
{
    int a;
    int b;
}
------------------------------------------------

First example compiles with 2.062

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=10708

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P3

--
December 13
https://issues.dlang.org/show_bug.cgi?id=10708

--- Comment #3 from dlangBugzillaToGithub <robert.schadek@posteo.de> ---
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/18638

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB

--