closes #9594
@@ -451,6 +451,13 @@ let unify_int ctx e k =
match follow t with
| TAnon a ->
(try is_dynamic (PMap.find f a.a_fields).cf_type with Not_found -> false)
+ | TMono m ->
+ begin match Monomorph.classify_constraints m with
+ | CStructural(fields,_) ->
+ (try is_dynamic (PMap.find f fields).cf_type with Not_found -> false)
+ | _ ->
+ true
+ end
| TInst (c,tl) ->
(try is_dynamic (apply_params c.cl_params tl ((let _,t,_ = Type.class_field c tl f in t))) with Not_found -> false)
| _ ->
@@ -0,0 +1,15 @@
+package unit.issues;
+import unit.Test;
+
+class Issue9594 extends Test {
+ function test() {
+ var arr:Array<Array<Int>> = [];
+ arr.sort(sort);
+ utest.Assert.pass();
+ }
+ static function sort(a, b) {
+ if (a.length != b.length) return a.length - b.length;
+ return 0;
+}