Closed
Description
It took me a while to figure out a bug related to this. Dart2js currently allows const maps with types as keys, but lookup functions fail.
Here is a simple example that reproduces the problem:
class A {}
var m1 = { A: 1};
const m2 = const {A: 2};
main() {
var t = new A().runtimeType;
print('${m1[A]} ${m2[A]} ${m1[t]} ${m2[t]}');
print(m2.keys.first == t)
}
This program works in the vm, there it prints:
1 2 1 2
true
in dart2js it prints:
1 2 1 null
true