https://d.puremagic.com/issues/show_bug.cgi?id=11714
Summary: Improve error message for wrongly initialized
thread-local class instances
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Joseph Rushton Wakeling <[email protected]>
2013-12-10 02:45:33 PST ---
If a developer tries to initialize a static/thread-local class instance with a
value not knowable at compile time, the compiler will object with an error
message as follows:
Error: variable %s is mutable. Only const or immutable class thread local
variable are allowed, not %s
This easily leads to the wrong conclusion that thread-local class instances
must themselves be const or immutable, rather than the reality that the
initialization value must be.
This error message should be replaced with something more friendly, along the
lines of
Cannot initialize thread-local class variable %s with a mutable value.
Only const or immutable initial values are allowed (e.g. null).
Background:
http://forum.dlang.org/post/[email protected]
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------