[Issue 16041] New: Forward reference with auto return

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed May 18 03:33:38 PDT 2016


          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 at puremagic.com
          Reporter: maxsamukha at 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()'


More information about the Digitalmars-d-bugs mailing list