Module name conflicts with field
Lionello Lunesu
lio at lunesu.remove.com
Mon Oct 16 06:10:54 PDT 2006
Hi,
I got an unexpected error message ("no property X for type Y") and got
it down to the following minimal test case:
#module test;
#struct A { }
#struct B {
# test.A a;
# int test;
#}
#void main() {}
Compiling with DMD 0.169 gives:
test.d(4): no property 'A' for type 'int'
test.d(4): test.A is used as a type
test.d(4): variable test.B.a voids have no value
The "test" on line 4 is interpreted as a field name (strange place for a
field name) instead of the module name. Commenting either line 4 or 5
gets rid of the errors.
Obviously, using "test.A" makes no sense here, but in the original
project an imported module conflicted with a field of the struct.
I think the code is valid, since there seems to be no conflict between a
module name and field names if I comment only one of the lines in the
struct.
L.
More information about the Digitalmars-d-learn
mailing list