Pārlūkot izejas kodu

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

Simon Krajewski 10 gadi atpakaļ
vecāks
revīzija
d10551d3d8
1 mainītis faili ar 2 papildinājumiem un 4 dzēšanām
  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, _ ->