Thread overview | |||||
---|---|---|---|---|---|
|
February 15, 2009 [Issue 2666] New: forward reference hell! | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=2666 Summary: forward reference hell! Product: D Version: unspecified Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: P1 Component: DMD AssignedTo: bugzilla@digitalmars.com ReportedBy: someanon@yahoo.com $ cat vector.d #----------------------------------------------------- module vector; class Vector(E) { E[] data; } $ cat student.d #----------------------------------------------------- module student; import vector; import teacher; // define Student class Student { void ask(Teacher teacher) { } } // define Students alias Vector!(Student) Students; $ cat teacher.d #----------------------------------------------------- module teacher; import student; class Teacher { Students students; } =============================================== $ dmd -c student.d teacher.d(6): Error: forward reference to 'Vector!(Student)' teacher.d(6): Error: Students is used as a type teacher.d(6): variable teacher.Teacher.students voids have no value =============================================== sure I know if I do: $ dmd -c vector.d teacher.d student.d all the three files can be compiled without error. But my question is: why can't file be individually compiled? I think I have the most natural/logical organization of files; if you move the 'Students' alias around, it could get compiled, but what's wrong with my current organization? -- |
February 15, 2009 [Issue 2666] forward reference hell! | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=2666 ------- Comment #1 from someanon@yahoo.com 2009-02-14 19:16 ------- Created an attachment (id=290) --> (http://d.puremagic.com/issues/attachment.cgi?id=290&action=view) source file -- |
February 15, 2012 [Issue 2666] forward reference hell! | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=2666 Lukasz Wrzosek <luk.wrzosek@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |luk.wrzosek@gmail.com Resolution| |FIXED --- Comment #2 from Lukasz Wrzosek <luk.wrzosek@gmail.com> 2012-02-15 04:12:19 PST --- Fixed in: https://github.com/D-Programming-Language/dmd/commit/a7e086246fa84279a5e16ed39c9b3f015057544a commit a7e086246fa84279a5e16ed39c9b3f015057544a Author: Walter Bright <walter@digitalmars.com> Date: Mon Aug 9 04:30:47 2010 +0000 bugzilla 4503 forward reference to aliased template instance -- 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