Re: Explicit casting of enum -- intentional restriction?

2016-10-02 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, October 02, 2016 12:00:05 rcorre via Digitalmars-d-learn wrote: > Thanks for tracking that down. I think the bug is that a > string-typed enum passes isSomeString but not isInputRange. It > should either be both or neither. I filed > https://issues.dlang.org/show_bug.cgi?id=16573. I rea

Re: Explicit casting of enum -- intentional restriction?

2016-10-02 Thread rcorre via Digitalmars-d-learn
On Sunday, 2 October 2016 at 10:52:59 UTC, Marc Schütz wrote: On Saturday, 1 October 2016 at 20:52:48 UTC, rcorre wrote: I just tried to compile an old project and the following failed: --- enum Paths : string { bitmapDir = "content/image", fontDir = "content/font", soundDir

Re: Explicit casting of enum -- intentional restriction?

2016-10-02 Thread Marc Schütz via Digitalmars-d-learn
On Saturday, 1 October 2016 at 20:52:48 UTC, rcorre wrote: I just tried to compile an old project and the following failed: --- enum Paths : string { bitmapDir = "content/image", fontDir = "content/font", soundDir = "content/sound", ... if (Paths.preferences.exists) ...

Re: Explicit casting of enum -- intentional restriction?

2016-10-01 Thread Namespace via Digitalmars-d-learn
The Code below still works, so I guess it's some problem with the constraint of "exists". import std.stdio; enum Foo { A = "B" } void test(string a) { } void main() { test(Foo.A); Foo.A.test(); }

Explicit casting of enum -- intentional restriction?

2016-10-01 Thread rcorre via Digitalmars-d-learn
I just tried to compile an old project and the following failed: --- enum Paths : string { bitmapDir = "content/image", fontDir = "content/font", soundDir = "content/sound", ... if (Paths.preferences.exists) ... --- It turns out members of Paths are no longer implicitly