On Wednesday, 27 February 2019 at 17:23:21 UTC, Q. Schroll wrote:
For whatever reason, when I put the code in a struct, the @safe testing line tells me, it's @system now.

I tested a bit, and it appears that attribute inference is not done at all for templates inside structs -the attribute need not be a delegate:

struct S
    {
        static int fImpl(Ret)() { return Ret.init; }

pragma(msg, __traits(getFunctionAttributes, fImpl!int)); // still tells us: `f` is @system
    }

void main(){}

A bug, unless I'm overlooking something.

Reply via email to