www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6520] New: Problem with -inline with lazy arguments and inner functions

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6520

           Summary: Problem with -inline with lazy arguments and inner
                    functions
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc



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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 17 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6520


SomeDude <lovelydear mailmetrash.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lovelydear mailmetrash.com



PDT ---
Compiles fine with -inline on 2.059 Win32

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 26 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6520


bearophile_hugs eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




 Compiles fine with -inline on 2.059 Win32
Thank you. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 26 2012