[Issue 2474] New: Recursive lazy arguments are inlined incorrectly
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Nov 26 16:24:07 PST 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2474
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: bugzilla at digitalmars.com
ReportedBy: snake.scaly at gmail.com
This code:
--8<-----------
int foo(lazy int x)
{
int bar()
{
return foo(bar());
}
return bar();
}
--8<-----------
produces the following output when compiled:
> dmd inlinebug.d -c -inline
inlinebug.d(5): delegate inlinebug.foo.bar.__dgliteral1 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.
--
More information about the Digitalmars-d-bugs
mailing list