Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
October 08, 2008 [Issue 2402] New: Type is not found if accessed via renamed import | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=2402 Summary: Type is not found if accessed via renamed import Product: D Version: 2.019 Platform: PC OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla@digitalmars.com ReportedBy: 2korden@gmail.com module m1; struct Foo { int x; } module m2; struct Foo { int x; int y; } module m; import M1 = m1; import M2 = x2; // line 4 import M2 = m2; // line 5 M2.Foo convert(M1.Foo foo) { M2.Foo result = void; result.x = foo.x; result.y = foo.y; return result; } m.d(7): Error: identifier 'Foo' of 'M2.Foo' is not defined m.d(7): Error: M2.Foo is used as a type Note that swapping lines 4 and 5 workarounds the issue. But there appears another issue: m.d(11): Error: no property 'y' for type 'Foo' Which one? Error should mention be M1.Foo instead of just Foo. (Shall I move it into separate enhancement issue?) -- |
November 24, 2008 [Issue 2402] Type is not found if accessed via renamed import | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=2402 smjg@iname.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |smjg@iname.com Keywords| |diagnostic ------- Comment #1 from smjg@iname.com 2008-11-24 10:35 ------- The first thing it complains about should be that x2 is not found. Or if it is, that M2 is defined twice. I agree about your last comment. It should probably be (and might already be, but I'm not sure) filed as a separate issue. -- |
February 14, 2012 [Issue 2402] [module] Type is not found if accessed via renamed import | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=2402 dawg@dawgfoto.de changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |dawg@dawgfoto.de Resolution| |WORKSFORME --- Comment #2 from dawg@dawgfoto.de 2012-02-14 05:35:41 PST --- cat > m1.d << CODE module m1; struct Foo { int x; } CODE cat > m2.d << CODE module m2; struct Foo { int x; int y; } CODE cat > m.d << CODE module m; import M1 = m1; import M2 = x2; // line 4 import M2 = m2; // line 5 M2.Foo convert(M1.Foo foo) { M2.Foo result = void; result.x = foo.x; result.y = foo.y; return result; } CODE dmd -c m.d ---------- With dmd2.057: m.d(4): Error: module x2 is in file 'x2.d' which cannot be read -- 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