www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16041] New: Forward reference with auto return


          Issue ID: 16041
           Summary: Forward reference with auto return
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: maxsamukha gmail.com

The compiler should be able to resolve the return type:

struct Tree {
    Tree* left;

auto fmap() {
    return new Tree(fmap());

void main()

Error: forward reference to inferred return type of function call 'fmap()'

May 18 2016