www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - phobos' std.typecons and D1

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 
  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.

Dec 09 2007