November 15, 2006 [Issue 514] New: Misleading error message for static const initialisation | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=514 Summary: Misleading error message for static const initialisation Product: D Version: 0.174 Platform: PC OS/Version: Windows Status: NEW Keywords: diagnostic Severity: trivial Priority: P5 Component: DMD AssignedTo: bugzilla@digitalmars.com ReportedBy: deewiant@gmail.com class C { static const int x; this() { x = 2; } } The above code errors out with "Error: can only initialize const x inside constructor". This is rather unclear, as x _is_ being initialised inside a constructor. The compiler should notify that the variable is static and thus needs to be initialised in a static constructor. -- |
December 03, 2006 [Issue 514] Misleading error message for static const initialisation | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=514 deewiant@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED ------- Comment #1 from deewiant@gmail.com 2006-12-03 03:42 ------- Fixed in DMD 0.176. -- |
Copyright © 1999-2021 by the D Language Foundation