HaxeFoundation / haxe

Haxe - The Cross-Platform Toolkit
https://haxe.org
6.14k stars 654 forks source link

[eval] Instance prototype not found: haxe.iterators.MapKeyValueIterator (without abstracts) #10039

Closed Aurel300 closed 3 years ago

Aurel300 commented 3 years ago
class Main {
  public static function main():Void foo([]);
  static function foo<T>(map:Map<T, Int>):Void for (k => v in map) {}
}

9712 seems to be about abstracts, here the issue is reproduced simply with a generic. It only errors out when T is the key type, with Map<Int, T> it works.

RealyUniqueName commented 3 years ago

It's a regression in development branch. @:multitype requires type parameters to be known at compile time. That sample should error out. Here's how it looks with 4.1.4:

Main.hx:2: characters 42-44 : Type parameters of multi type abstracts must be known (for haxe.IMap<Unknown<0>, Int>)