[Issue 852] ICE in dmd with anon. delegate in static class ctor in unittest

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Feb 23 14:36:27 PST 2007


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


thomas-dloop at kuehne.cn changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|ice-on-valid-code           |




------- Comment #1 from thomas-dloop at kuehne.cn  2007-02-23 16:36 -------
The code isn't legal:

1 # void test(){
2 #    class Foo{
3 #       static this(){
4 #          auto i = {
5 #             return new Foo;
6 #          };
7 #       }
8 #    }
9 # }

Line 5 requires access to test's context pointer, thus it should fail because 
line 3 can't provide one.
Change "class Foo" to "static class Foo" to sidestep the problem.

Added to DStress as
http://dstress.kuehne.cn/nocompile/b/bug_toir_170_A.d
http://dstress.kuehne.cn/nocompile/b/bug_toir_170_B.d


-- 



More information about the Digitalmars-d-bugs mailing list