Browse Source

fix static call through abstract instance check (see #3616)

Simon Krajewski 10 năm trước cách đây
mục cha
commit
d10551d3d8
1 tập tin đã thay đổi với 2 bổ sung4 xóa
  1. 2 4
      typer.ml

+ 2 - 4
typer.ml

@@ -1589,11 +1589,9 @@ and type_field ?(resume=false) ctx e i p mode =
 					| [] -> f
 					| cfl -> loop (f :: cfl)
 				in
+				if not (Meta.has Meta.Impl f.cf_meta) then
+					error ("Invalid call to static function " ^ i ^ " through abstract instance") p;
 				let t = field_type f in
-				begin match follow t with
-					| TFun((_,_,t1) :: _,_) -> ()
-					| _ -> error ("Invalid call to static function " ^ i ^ " through abstract instance") p
-				end;
 				let ef = field_expr f t in
 				AKUsing (ef,c,f,e)
 			| MSet, _ ->