digitalmars.D.bugs - [Issue 5865] New: __dollar cannot be read at compile time
- d-bugmail puremagic.com (32/32) Apr 19 2011 http://d.puremagic.com/issues/show_bug.cgi?id=5865
- d-bugmail puremagic.com (26/26) Apr 20 2011 http://d.puremagic.com/issues/show_bug.cgi?id=5865
- d-bugmail puremagic.com (11/11) Apr 30 2011 http://d.puremagic.com/issues/show_bug.cgi?id=5865
- d-bugmail puremagic.com (12/12) Apr 30 2011 http://d.puremagic.com/issues/show_bug.cgi?id=5865
http://d.puremagic.com/issues/show_bug.cgi?id=5865 Summary: __dollar cannot be read at compile time Product: D Version: D2 Platform: All OS/Version: Windows Status: NEW Severity: regression Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: changlon gmail.com --- Comment #0 from changlon <changlon gmail.com> 2011-04-19 18:06:47 PDT --- this working on dmd 2.052 release, throw error on dmd git master . ------------------------------------------ class Test1(string name, string file = __FILE__){ static const _file = file ; void test1(){ static const string file2 = _file[0..$] ; } } void main(){ auto obj = new Test1!"Test1" ; obj.test1(); } ----------------------------------------- test.d(5): Error: variable __dollar cannot be read at compile time test.d(5): Error: variable __dollar cannot be read at compile time test.d(10): Error: template instance test.Test1!("Test1") error instantiating -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 19 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5865 Don <clugdbug yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch, rejects-valid CC| |clugdbug yahoo.com.au --- Comment #1 from Don <clugdbug yahoo.com.au> 2011-04-20 02:06:21 PDT --- PATCH dsymbol.c, line 1181. if (!*pvar) // if not already initialized { /* Create variable v and set it to the value of $, * which will be a constant. */ VarDeclaration *v = new VarDeclaration(loc, Type::tsize_t, Id::dollar, NULL); if (ce->op == TOKvar) { // if ce is const, get its initializer - ce = fromConstInitializer(WANTvalue, ce); + ce = fromConstInitializer(WANTvalue | WANTexpand, ce); } if (ce->op == TOKstring) { /* It is for a string literal, so the * length will be a const. */ -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 20 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5865 Walter Bright <bugzilla digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bugzilla digitalmars.com --- Comment #2 from Walter Bright <bugzilla digitalmars.com> 2011-04-30 10:43:21 PDT --- D2 fix: https://github.com/D-Programming-Language/dmd/commit/0c9c52c7123e7336ce732e72099dbebd183742e2 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 30 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5865 Walter Bright <bugzilla digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #3 from Walter Bright <bugzilla digitalmars.com> 2011-04-30 11:30:48 PDT --- D1 fix: https://github.com/D-Programming-Language/dmd/commit/bd196a9020883d94c7b7c4d8a91943d5735f4f3c -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 30 2011