how does the haxe3 new map works?

33 views
Skip to first unread message

davy zhang

unread,
Feb 19, 2014, 6:59:39 AM2/19/14
to haxe...@googlegroups.com
I copied the code from the mannual it doesn't compile.

simple as 

var map = new Map();

it gives me a compile error:

Type parameters of multi type abstracts must be known (for IMap<Unknown<0>, Unknown<1>>)

which map should I use?

I am using haxe3.0.1

Luca

unread,
Feb 19, 2014, 8:16:44 AM2/19/14
to haxe...@googlegroups.com
var map = new Map<String, Int>();

will compile

var map:Map<String, Int> = new Map();

will compile


var map = new Map();
map["hiya"] = 10;

will also compile.

The problem with trying to compile 'JUST' 'var map = new Map();' is the compiler doesn't have enough information to infer the type parameters.
Reply all
Reply to author
Forward
0 new messages