October 03, 2009 [Issue 102] Forward reference nested class wheel. | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=102 --- Comment #11 from Rainer Schuetze <r.sagitario@gmx.de> 2009-10-03 06:27:15 PDT --- (In reply to comment #8) > IMHO this is a VERY promising patch since it potentially fixes many difficult > issues. It's not quite complete though. > I've run it though Walter's test suite, and one test fails (all others pass). > The code below should fail to compile, but instead the compiler gets into an > infinite loop --- it's an ice-on-invalid-code regression. > > ---- > struct A (T) { > mixin B! (T, A! (T)); > } > > A!(int) x; > ---- I've been running into a similar problem with const initializers, that already use a similar mechanism in DMD 2.032. If anonymous classes are involved, it might freeze as well instead of producing an error. It took more time to extract a sensible test case than to patch it, but here it is module test; class C { const int a = (new class Object { int x; }).sizeof + y; S s; } struct S { int s1; } "dmd -c test.d" causes dmd to freeze, instead of reporting "undefined identifer y". And this is the additional patch (line number might be skewed a little): Index: declaration.c =================================================================== --- declaration.c (revision 196) +++ declaration.c (working copy) @@ -1106,6 +1155,7 @@ if (!global.errors && !inferred) { + unsigned progress = Module::dprogress; unsigned errors = global.errors; global.gag++; //printf("+gag\n"); @@ -1127,6 +1177,7 @@ //printf("-gag\n"); if (errors != global.errors) // if errors happened { + Module::dprogress = progress; // we are throwing away the expression copy, so no progress if (global.gag == 0) global.errors = errors; // act as if nothing happened #if DMDV2 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
December 29, 2009 [Issue 102] Forward reference nested class wheel. | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=102 Rainer Schuetze <r.sagitario@gmx.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #459 is|0 |1 obsolete| | --- Comment #12 from Rainer Schuetze <r.sagitario@gmx.de> 2009-12-29 06:52:41 PST --- Created an attachment (id=537) updated patch again This is another update with the proposed addition and 2 little extensions: - when a struct is searched for identifiers, and its semantic analysis is deferred, try the semantic analysis again. This is already done for classes and is simply extended to structs. - retrying deferred analysis is only done when any "progress" has been made (i.e. new classes or structs have been analysed). This reduces the performance and memory penalties caused by the deferral mechanism. This patch is necessary to compile QtD with DMD 2.037. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
March 27, 2010 [Issue 102] Forward reference nested class wheel. | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=102 --- Comment #13 from Rainer Schuetze <r.sagitario@gmx.de> 2010-03-27 06:29:36 PDT --- As much as I can see, all test cases in this report compile since dmd 1.054 and dmd 2.038. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
March 27, 2010 [Issue 102] Forward reference nested class wheel. | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=102 Don <clugdbug@yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #14 from Don <clugdbug@yahoo.com.au> 2010-03-27 06:46:57 PDT --- (In reply to comment #13) > As much as I can see, all test cases in this report compile since dmd 1.054 and dmd 2.038. Confirmed. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation