digitalmars.D.bugs - [Issue 6969] New: Forward reference on template class triangle
- d-bugmail puremagic.com (34/35) Nov 17 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6969
- d-bugmail puremagic.com (11/11) Nov 21 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6969
- d-bugmail puremagic.com (27/27) Dec 06 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6969
- d-bugmail puremagic.com (7/7) Dec 06 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6969
- d-bugmail puremagic.com (12/12) Apr 23 2012 http://d.puremagic.com/issues/show_bug.cgi?id=6969
- d-bugmail puremagic.com (11/11) Apr 28 2012 http://d.puremagic.com/issues/show_bug.cgi?id=6969
- d-bugmail puremagic.com (17/17) Apr 29 2012 http://d.puremagic.com/issues/show_bug.cgi?id=6969
- d-bugmail puremagic.com (8/8) Nov 09 2012 http://d.puremagic.com/issues/show_bug.cgi?id=6969
- d-bugmail puremagic.com (48/61) Nov 10 2012 http://d.puremagic.com/issues/show_bug.cgi?id=6969
- d-bugmail puremagic.com (67/68) Nov 10 2012 http://d.puremagic.com/issues/show_bug.cgi?id=6969
- d-bugmail puremagic.com (10/10) Nov 13 2012 http://d.puremagic.com/issues/show_bug.cgi?id=6969
- d-bugmail puremagic.com (12/12) Nov 13 2012 http://d.puremagic.com/issues/show_bug.cgi?id=6969
- d-bugmail puremagic.com (9/9) Nov 13 2012 http://d.puremagic.com/issues/show_bug.cgi?id=6969
http://d.puremagic.com/issues/show_bug.cgi?id=6969 Summary: Forward reference on template class triangle Product: D Version: D2 Platform: Other OS/Version: Windows Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: cbkbbejeap mailinator.com Blocks: 340 --- Comment #0 from Nick Sabalausky <cbkbbejeap mailinator.com> 2011-11-17 18:20:08 PST --- class A() { alias C!() C1; } class B { alias A!() A1; } class C() : B { }dmd -c text.dtest.d(9): Error: class test.C!().C has forward references test.d(7): Error: template instance test.A!() error instantiating Problem cannot be worked around by rearranging order of declaration. All 6 possible orders exhibit the "has forward references" error. Might be related to #3834 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 17 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6969 Nick Sabalausky <cbkbbejeap mailinator.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |critical --- Comment #1 from Nick Sabalausky <cbkbbejeap mailinator.com> 2011-11-21 13:50:16 PST --- Severity -> critical This is blocking a major refactoring in my project. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 21 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6969 --- Comment #2 from Nick Sabalausky <cbkbbejeap mailinator.com> 2011-12-06 16:57:34 PST --- I'm not very familiar with DMD's internals wrt semantics, but from what I can tell so far, the problem may have to do with a certain section near the end of TemplateInstance::semantic(Scope *sc, Expressions *fargs): ... /* The problem is when to parse the initializer for a variable. * Perhaps VarDeclaration::semantic() should do it like it does * for initializers inside a function. */ // if (sc->parent->isFuncDeclaration()) /* BUG 782: this has problems if the classes this depends on * are forward referenced. Find a way to defer semantic() * on this template. */ semantic2(sc2); ... That call to semantic2 is the call stack when the "has forward references" error is thrown. Note that this occurs before tryMain() reaches semantic2. Do to my inexperience with DMD's internals, I have no idea if there's some reason that call to semantic2 is supposed to be there. And I don't understand what those comments are trying to say. But if I comment out that semantic2 call, the test case passes. However, I don't know whether that breaks anything else. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 06 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6969 --- Comment #3 from Nick Sabalausky <cbkbbejeap mailinator.com> 2011-12-06 16:59:05 PST --- *Ahem*: "That call to semantic2 is *IN* the call stack..." -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 06 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6969 Nick Sabalausky <cbkbbejeap mailinator.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|critical |blocker --- Comment #4 from Nick Sabalausky <cbkbbejeap mailinator.com> 2012-04-23 17:58:53 PDT --- Commenting out that call to semantic2 no longer fixes the problem in latest DMD in Git (and Phobos fails to rebuild with the change). So I've got no clue. But this is still blocking me from some major refactoring I need to do. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 23 2012
http://d.puremagic.com/issues/show_bug.cgi?id=6969 Walter Bright <bugzilla digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bugzilla digitalmars.com --- Comment #5 from Walter Bright <bugzilla digitalmars.com> 2012-04-28 02:04:29 PDT --- It's not really a forward reference, it's a circular one. B is defined in terms of itself. I'm not sure how this could ever work. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 28 2012
http://d.puremagic.com/issues/show_bug.cgi?id=6969 --- Comment #6 from Nick Sabalausky <cbkbbejeap mailinator.com> 2012-04-29 21:23:36 PDT --- This works: class A { alias C C1; } class B { alias A A1; } class C : B { } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 29 2012
http://d.puremagic.com/issues/show_bug.cgi?id=6969 Nick Sabalausky <cbkbbejeap mailinator.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|blocker |critical -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 09 2012
http://d.puremagic.com/issues/show_bug.cgi?id=6969 Rob T <alanb ucora.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |alanb ucora.com --- Comment #7 from Rob T <alanb ucora.com> 2012-11-10 00:39:04 PST --- (In reply to comment #6)This works: class A { alias C C1; } class B { alias A A1; } class C : B { }It works because there are no actual circular references, and that's because the class alias are in reality pointers, and pointers are known data types irrespective of what they may represent (the definition expansion should stop at the pointer). The compiler is certainly able to determine what the pointers represent for dereferencing purposes as the class structures and contents are 100% knowable. Note that if you convert the pointers to represent structs, ie change class to struct, and fix up struct C to contain struct B due to a lack of inheritance, it will no longer work, which is to be expected. To make the struct version work again, you simply change the contained B to a pointer. // this fails, and it should fail, so we're good. struct A() { C!() C1; } struct B { A!() A1; } struct C() { B s; } // this works, and it should work, so we're good. struct A() { C!() C1; } struct B { A!() A1; } struct C() { B* s; // changed to pointer } The problem at hand is definitely a bug from what I see. --rt -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 10 2012
http://d.puremagic.com/issues/show_bug.cgi?id=6969 --- Comment #8 from Rob T <alanb ucora.com> 2012-11-10 01:34:57 PST --- (In reply to comment #7)(In reply to comment #6)I get weird behavior if I put in only the alias definitions. This stuct version compiles, and it probably should because sA and sB are empty with no circular referencing. struct sA() { alias sC!() sC1; } struct sB { alias sA!() sA1; } struct sC() { sB s; } But adding sA1 into sB will not compile, but I think it should compile because sA is empty and there's no circular reference back to sC. struct sA() { alias sC!() sC1; } struct sB { alias sA!() sA1; sA1 a; } struct sC() { sB b; } In fact it does compile in the non-template version as expected. struct sA { alias sC sC1; } struct sB { alias sA sA1; sA1 a; } struct sC() { sB b; } Finally, closing the loop will not compile as expected struct sA { alias sC sC1; sC1 c; // bang, we're dead. } struct sB { alias sA sA1; sA1 a; } struct sC() { sB b; } Templates and non-templates are being evaluated inconsistently, so there's definitely a bug in there somewhere. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 10 2012
http://d.puremagic.com/issues/show_bug.cgi?id=6969 Kenji Hara <k.hara.pg gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |pull --- Comment #9 from Kenji Hara <k.hara.pg gmail.com> 2012-11-13 04:19:05 PST --- https://github.com/D-Programming-Language/dmd/pull/1280 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 13 2012
http://d.puremagic.com/issues/show_bug.cgi?id=6969 --- Comment #10 from github-bugzilla puremagic.com 2012-11-13 12:27:37 PST --- Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/75b0fafc74eda2fed816415e31dcbfde8283077d fix Issue 6969 - Forward reference on template class triangle https://github.com/D-Programming-Language/dmd/commit/c34c5fb0e67f7c48bb683ef409378fde6db33088 Merge pull request #1280 from 9rnsr/fix8990 Issue 6969 & 8990 - Forward reference error between three template instantiations -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 13 2012
http://d.puremagic.com/issues/show_bug.cgi?id=6969 Walter Bright <bugzilla digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 13 2012