Explorar o código

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

Simon Krajewski %!s(int64=10) %!d(string=hai) anos
pai
achega
d10551d3d8
Modificáronse 1 ficheiros con 2 adicións e 4 borrados
  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, _ ->