ensure semantic run when searching struct for members
text/plain
1146
Comments
Comment #0 by jarrett.billingsley — 2006-08-10T22:43:12Z
I really don't know what else to call this, and it's a bit tedious to get to happen. So here's the general idea:
------ [modules/test1.d] --------
module modules.test1;
import modules.test2;
struct A
{
enum B
{
One,
Two
}
}
void bar()
{
foo();
}
--------- [modules/test2.d] ---------
module modules.test2;
import modules.test1;
A.B foobar; // error, no property B for type A?!
void foo()
{
int x;
if(x == A.B.One) // but this is OK
x = 1;
}
---------------------------------
Some interesting facts:
- This only seems to happen if the modules are in a package. If they're two top-level modules, it works fine.
- Notice I can't use A.B as a type, but I can in fact access A.B's members.
- Using static imports/aliased imports does not help.
I don't know how to get it to not work the way it does in MiniD - that is, I can't even use A.B in the same module that A.B is defined!
This is, for me, something of a showstopper.. I'll probably be using 0.162 for a bit, which is sad, considering how cool the 0.163 features are! I don't know if I should change the priority of this bug, but this is something that can't be worked around easily, so I'd put it pretty high up there.
Comment #1 by dawid.ciezarkiewicz — 2006-08-11T07:32:12Z
Related to #204. Maybe even same problem.
Comment #2 by dawid.ciezarkiewicz — 2006-08-11T07:33:27Z
(In reply to comment #1)
> Related to #204. Maybe even same problem.
>
Err. #102 . Sorry.
Comment #3 by r.sagitario — 2009-09-18T00:56:35Z
Created attachment 455
ensure semantic run when searching struct for members
When searching members of a class that is not yet semantically analyzed, the analysis is run on it. This is not done for structs or unions, which is probably an omission.
Comment #4 by bugzilla — 2009-12-29T03:07:49Z
Changeset 318
Comment #5 by leandro.lucarella — 2009-12-29T09:02:30Z