Re: Unable to understand this compiler error

2012-10-11 Thread bearophile
Anyway, this seems a compiler bug, so probably it should be added to bugzilla. http://d.puremagic.com/issues/show_bug.cgi?id=8802

Re: Unable to understand this compiler error

2012-10-10 Thread bearophile
Lubos Pintes: Interesting. In treeview module I mentioned, there is an enum containing some numeric values cast from HTREEITEM, which is in fact HANDLE, which is void* if I understand properly. I tried to convert DGUI to use dsource' WindowsAPI project, and at least from compiler perspective,

Re: Unable to understand this compiler error

2012-10-10 Thread Lubos Pintes
Interesting. In treeview module I mentioned, there is an enum containing some numeric values cast from HTREEITEM, which is in fact HANDLE, which is void* if I understand properly. I tried to convert DGUI to use dsource' WindowsAPI project, and at least from compiler perspective, everything worke

Re: Unable to understand this compiler error

2012-10-10 Thread bearophile
Lubos Pintes: I see no "void" there, except that foo has a return type of void. Minimized: enum Foo : void* { a = null } void main() { auto f = Foo.a; } enums are good for ints, ubytes, longs, chars, etc. The more types you try to put in them, the more compiler holes you will find

Re: Unable to understand this compiler error

2012-10-10 Thread Jesse Phillips
On Wednesday, 10 October 2012 at 14:52:00 UTC, Lubos Pintes wrote: 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)-

Unable to understand this compiler error

2012-10-10 Thread Lubos Pintes
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 fo