[Issue 4923] immutable module variables are modifiable in non-shared module constructors
https://issues.dlang.org/show_bug.cgi?id=4923 Les De Ridder changed: What|Removed |Added CC||dl...@lesderid.net --
[Issue 4923] immutable module variables are modifiable in non-shared module constructors
https://issues.dlang.org/show_bug.cgi?id=4923 Dlang Bot changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #9 from Dlang Bot --- dlang/dmd pull request #9754 "Fix issue 4923: Deprecate modifying immutable variable from `static this`" was merged into master: - 7c4ccb75c9aee7dfaac66c65fe0fb11d29bca8b9 by Geod24: Fix issue 4923: Deprecate modifying immutable variable from `static this` https://github.com/dlang/dmd/pull/9754 --
[Issue 4923] immutable module variables are modifiable in non-shared module constructors
https://issues.dlang.org/show_bug.cgi?id=4923 Dlang Bot changed: What|Removed |Added Keywords||pull --- Comment #8 from Dlang Bot --- @Geod24 created dlang/dmd pull request #9754 "Fix issue 4923: Deprecate modifying immutable variable from `static this`" fixing this issue: - Fix issue 4923: Deprecate modifying immutable variable from `static this` https://github.com/dlang/dmd/pull/9754 --
[Issue 4923] immutable module variables are modifiable in non-shared module constructors
https://issues.dlang.org/show_bug.cgi?id=4923 Steven Schveighoffer changed: What|Removed |Added Keywords|pull| CC||schvei...@yahoo.com --
[Issue 4923] immutable module variables are modifiable in non-shared module constructors
https://issues.dlang.org/show_bug.cgi?id=4923 --- Comment #7 from Steven Schveighoffer --- *** Issue 6114 has been marked as a duplicate of this issue. *** --
[Issue 4923] immutable module variables are modifiable in non-shared module constructors
https://issues.dlang.org/show_bug.cgi?id=4923 --- Comment #6 from Jonathan M Davis --- An updated example, since Thread.sleep now requires that its argument be a core.time.Duration: import core.thread, std.random, std.stdio; immutable int x; static this() { x = unpredictableSeed; } void main() { for(;;) { (new Thread({ })).start; Thread.sleep(seconds(1)); writeln(x); } } --
[Issue 4923] immutable module variables are modifiable in non-shared module constructors
http://d.puremagic.com/issues/show_bug.cgi?id=4923 --- Comment #5 from github-bugzi...@puremagic.com 2013-06-30 15:58:06 PDT --- Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/f5ed82d638b373efb6c2f0c77d64259df9472964 Merge pull request #1376 from yebblies/issue4923 initialize first thread's message box in a normal static ctor, to work around requirement that thread-local variables cannot be set from a shared static constructor. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4923] immutable module variables are modifiable in non-shared module constructors
http://d.puremagic.com/issues/show_bug.cgi?id=4923 yebblies changed: What|Removed |Added Keywords||patch CC||yebbl...@gmail.com Platform|Other |All AssignedTo|nob...@puremagic.com|yebbl...@gmail.com OS/Version|Windows |All --- Comment #4 from yebblies 2012-02-01 16:57:05 EST --- https://github.com/D-Programming-Language/dmd/pull/675 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4923] immutable module variables are modifiable in non-shared module constructors
http://d.puremagic.com/issues/show_bug.cgi?id=4923 Jonathan M Davis changed: What|Removed |Added CC||jmdavisp...@gmx.com --- Comment #3 from Jonathan M Davis 2011-01-04 00:26:06 PST --- immutable variables are implicitly shared. That's part of the point of immutable after all. And given that fact, allowing the initializing of immutable variables in non-shared static constructors is definitely a bug. If we decided that immutable variables were _not_ implicitly shared and made it so that they weren't, then that would fix the problem, but that would on some level defeat the purpose of immutable. So, if we are going to have immutable variables be implicitly shared, then I propose that we disallow the initializing of immutable variables with global scope in non-shared static constructors. That is, all global variables and static variables which are immutable _must_ be initialized in shared static constructors. The non-static local variables would be okay (and I'm not sure that those actually end up being implicitly shared anyway), since they'd be re-created on each function call, but any immutable variable which could be initialized in a static constructor would have to be initialized in a shared static constructor. I don't really see any other viable way to fix this bug if we're going to continue to have immutable variables be implicitly shared. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4923] immutable module variables are modifiable in non-shared module constructors
http://d.puremagic.com/issues/show_bug.cgi?id=4923 --- Comment #2 from Kasumi Hanazuki 2010-09-23 18:25:30 PDT --- I have no idea whether the spec states immutable module variables to be allocated per thread or not, but currently DMD places them as shared and there seems no way to store them in TLS. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4923] immutable module variables are modifiable in non-shared module constructors
http://d.puremagic.com/issues/show_bug.cgi?id=4923 nfx...@gmail.com changed: What|Removed |Added CC||nfx...@gmail.com --- Comment #1 from nfx...@gmail.com 2010-09-23 16:04:20 PDT --- Isn't this by design? Immutable variables are per-thread, and normal module constructors are used to initialize per-thread data. You need a way to initialize immutable variables. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---