[Issue 9040] Assertion `precedence[e->op] != PREC_zero' failed instantiating anonymous class at compile time

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Nov 22 06:07:29 PST 2013


https://d.puremagic.com/issues/show_bug.cgi?id=9040



--- Comment #11 from yebblies <yebblies at gmail.com> 2013-11-23 01:07:27 EST ---
(In reply to comment #10)
> 
> I thought this had something to do with not allowing 'new'ing a class at
> compile-time. I don't quite understand where the limitation for TLS
> specifically came from, e.g.:
> 
> -----
> class Class { }
> static tls = new Class();  // NG
> __gshared glob = new Class();  // ok
> 
> void main() { }
> -----
> 
> Why is one allowed but not the other? And is this documented somewhere?

IIRC because all threads get the same tls init data, and end up referencing the
same class.  This could be fixed, but it doesn't currently work.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list