August 21, 2016
https://issues.dlang.org/show_bug.cgi?id=16410

          Issue ID: 16410
           Summary: attribute inference inside templated classes
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: rejects-valid
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody@puremagic.com
          Reporter: lodovico@giaretart.net
                CC: lodovico@giaretart.net

Example code:

class Bar(T)
{
    T t;

    // the following function is not inferred @nogc
    // changing return type to auto solves the issue
    ulong get()
    {
        return t.length;
    }
}

@nogc void main()
{
    import std.experimental.allocator;
    import std.experimental.allocator.mallocator;

    auto alloc = Mallocator.instance;

    auto x = alloc.make!(Bar!string).check;
    // error: @nogc main cannot call non-@nogc function check
}

--