http://d.puremagic.com/issues/show_bug.cgi?id=8432



--- Comment #3 from bearophile_h...@eml.cc 2012-07-25 11:54:03 PDT ---
(In reply to comment #2)

> enum Type { Class, Struct, Enum }
> 
> struct Class { }
> struct Struct { }
> struct Enum { }
> 
> void main()
> {
>     Type[string] type = ["foo" : Type.Class];
>     writeln(type);
> }
> 
> outputs:
> ["foo":Class]
> 
> This output confused me since Class is both a struct definition and a named
> enumerated value.

A partial solution is to add the type:

writeln(typeof(type).stringof, ": ", type);

It prints:

Type[string]: ["foo":Class]

Now you see that the keys can't be the struct name.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to