http://d.puremagic.com/issues/show_bug.cgi?id=5890
Summary: ICE and wrong scope problem for 2nd argument in static assert with DMD on git master Product: D Version: D2 Platform: Other OS/Version: Mac OS X Status: NEW Keywords: ice-on-valid-code, rejects-valid Severity: regression Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: kenn...@gmail.com --- Comment #0 from kenn...@gmail.com 2011-04-26 04:18:40 PDT --- This is a problem on the git master. This does not affect 2.052. The program below causes an ICE on the git master version: ------------------------------------------------- class K { void f() { static assert(0, typeof(this).stringof); } } void main() { (new K).f; } ------------------------------------------------- $ dmd2.052/osx/bin/dmd x # correct x.d(6): Error: static assert "K"c $ dmd x # incorrect Assertion failed: (this != enclosing), function Scope, file scope.c, line 132. Abort trap ------------------------------------------------- And the program below thinks the template parameter U does not exist: ------------------------------------------------- class K { static void f(U)() { static assert(0, U.stringof); } } void main() { K.f!int(); } ------------------------------------------------- $ dmd2.052/osx/bin/dmd x # correct x.d(6): Error: static assert "int"c x.d(11): instantiated from here: f!(int) $ dmd x # incorrect x.d(6): Error: undefined identifier U x.d(6): Error: static assert __error x.d(11): instantiated from here: f!(int) ------------------------------------------------- -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------