http://d.puremagic.com/issues/show_bug.cgi?id=852


Don <clugd...@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|ICE(toir.c) in dmd with     |ICE(toir.c) using local
                   |anon. delegate in static    |class in non-static nested
                   |class ctor in unittest      |function in nested static
                   |                            |function




--- Comment #3 from Don <clugd...@yahoo.com.au>  2009-05-27 04:32:51 PDT ---
Changed name from ICE(toir.c) in dmd with anon. delegate in static class ctor
in unittest, since it has nothing to do with delegates, static class
constructors, or unittest!

This reduced test case shows that it's caused by use of new of local class,
inside a non-static function nested inside static local function. 

---
void bar() {
    class Foo { }
    static void foo() {
        void pug() {
            Foo z = new Foo; 
        }
    }
}
---

If you move the 'static' from foo to pug, you get the error:

void bar() {
    class Foo { }
    void foo() {
        static void pug() {
            Foo z = new Foo; 
        }
    }
}

ice.d(8): Error: function ice.bar is a nested function and cannot be accessed
fr
om pug
But this seems to be a rejects-valid to me -- I can't see any reason why a
static nested function couldn't access a local class.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to