Przeglądaj źródła

[typer] fix functional interface type parameter leak

see #11390
Simon Krajewski 1 rok temu
rodzic
commit
b37c95ae43
1 zmienionych plików z 3 dodań i 1 usunięć
  1. 3 1
      src/context/abstractCast.ml

+ 3 - 1
src/context/abstractCast.ml

@@ -88,7 +88,9 @@ and do_check_cast ctx uctx tleft eright p =
 					end
 				| TInst(c,tl), TFun _ when has_class_flag c CFunctionalInterface ->
 					let cf = ctx.g.functional_interface_lut#find c.cl_path in
-					unify_raise_custom uctx eright.etype (apply_params c.cl_params tl cf.cf_type) p;
+					let map = apply_params c.cl_params tl in
+					let monos = Monomorph.spawn_constrained_monos map cf.cf_params in
+					unify_raise_custom uctx eright.etype (map (apply_params cf.cf_params monos cf.cf_type)) p;
 					eright
 				| _ ->
 					raise Not_found