Comment #0 by digitalmars-com — 2006-09-29T19:40:27Z
$ dmd testStructEnum.d
testStructEnum.d(6): no property 'Id' for type 'Value'
testStructEnum.d(6): Value.Id is used as a type
testStructEnum.d(6): cannot have parameter of type void
$ dmd testStructEnum.d -version=works
gcc testStructEnum.o -o testStructEnum -m32 -lphobos -lpthread -lm -Xlinker -L/home/bsmith/tools/d/dmd/lib
$ ./testStructEnum
1
----- testStructEnum.d -----
import std.stdio;
version(works) {
} else { // Doesn't work
void f(Value.Id t) {
writefln(cast(int)t);
}
}
struct Value {
public static enum Id {
A,
B
}
}
version(works) {
void f(Value.Id t) {
writefln(cast(int)t);
}
}
void main() {
Value.Id t = Value.Id.B;
f(t);
}
----------
Comment #1 by digitalmars-com — 2006-09-30T00:06:51Z
Fails on Windows XP also.
Comment #2 by smjg — 2006-11-16T18:39:55Z
It also fails with a struct nested within a struct. Probably part of the same bug. IIRC class within struct, struct within class and class within class all fail.
----------
struct Qwert {
Yuiop.Asdfg hjkl;
}
struct Yuiop {
struct Asdfg {
int zxcvb;
}
}
----------