Bug 6520 – Problem with -inline with lazy arguments and inner functions

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2011-08-17T07:47:00Z
Last change time
2012-04-26T13:07:56Z
Keywords
rejects-valid
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2011-08-17T07:47:52Z
A reduced program: int foo(int n, lazy int x) { int inner() { n--; return foo(n, inner()); }; return n <= 0 ? n : inner(); } void main() { assert(foo(10, 1) == 0); } With DMD 2.055beta it compiles and runs correctly. But compiling it with -inline DMD gives: test.d(4): Error: delegate test.foo.inner.__dgliteral3 is a nested function and cannot be accessed from foo
Comment #1 by lovelydear — 2012-04-26T11:40:42Z
Compiles fine with -inline on 2.059 Win32
Comment #2 by bearophile_hugs — 2012-04-26T13:07:56Z
(In reply to comment #1) > Compiles fine with -inline on 2.059 Win32 Thank you.