Unable to understand this compiler error

Lubos Pintes lubos.pintes at gmail.com
Wed Oct 10 07:27:57 PDT 2012


Hi,
I discovered this while playing with DGUI's treeview module. Here is a 
program that generates exactly the same error that looks weird to me:
module a;
import std.stdio;

alias void* pvoid;

enum E : pvoid {
   a=cast(pvoid)-1,
   b=cast(pvoid)-2,
}

void foo(E e=E.a) {
   writeln("Hello from foo");
}

void main() {
   foo();
}

a.d(11): Error: no property 'a' for type 'void'

I see no "void" there, except that foo has a return type of void.


More information about the Digitalmars-d-learn mailing list