phobos' std.typecons and D1

Bill Baxter dnewsgroup at billbaxter.com
Sun Dec 9 13:47:19 PST 2007


Can anyone figure out why typecons.d doesn't work with D1?
I get this compiler error:

bud -full -clean -I.. -unittest  typecons.d ..\..\utils\testmain.d
typecons.d(285): alias 
std2.typecons.defineEnum!("Abc","A",1,"B","C").defineEnum
  cannot alias an expression "enum Abc : int { A = 1, B = 2, C = 3, 
}\x0abool fromString(string s, ref Abc v) {\x0aif (s == `A`) return (v = 
Abc.A), true;\x0aif(s == `B`) return (v = Abc.B), true;\x0aif (s == `C`) 
return (v = Abc.C), true;\x0areturn false;\x0a}\x0astring toString(Abc 
v) {\x0aif (v == Abc.A) return `A`;\x0aif (v == Abc.B) return `B`;\x0aif 
(v == Abc.C) return `C`;\x0a}\x0a"



As far as I know D2 isn't supposed to have any newly gained features 
that would make the code work for D2 but not D1.

I'm trying to update "std2", the D1 backport D2's new phobos goodies.

--bb



More information about the Digitalmars-d mailing list