Summary: Recursive lazy arguments are inlined incorrectly
           Product: D
           Version: 2.021
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]

This code:

int foo(lazy int x)
  int bar()
    return foo(bar());
  return bar();

produces the following output when compiled:

> dmd inlinebug.d -c -inline
inlinebug.d(5): delegate is a nested function
and cannot be accessed from foo

Without the -inline flag this code compiles and works as expected.

The same bug is present in DMD 1.037.


Reply via email to