فهرست منبع

[typer] align some monomorphic weirdness

see #9594
Simon Krajewski 5 سال پیش
والد
کامیت
3ef7a2094d
1فایلهای تغییر یافته به همراه7 افزوده شده و 0 حذف شده
  1. 7 0
      src/typing/typer.ml

+ 7 - 0
src/typing/typer.ml

@@ -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)
 		| _ ->