浏览代码

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