www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16139] New: Attributes of functions inside templates should

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

          Issue ID: 16139
           Summary: Attributes of functions inside templates should be
                    inferred
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: bugzilla digitalmars.com

This should work for the same reason that template functions get their
attributes inferred:

template Mine()
{
    void foo()
    {
    }
}

 safe bar()
{
    Mine!().foo();
}

dmd test5
test.d(11): Error: safe function 'test.bar' cannot call system function
'test.Mine!().foo'

--
Jun 07 2016