Prechádzať zdrojové kódy

revert because haxelib

Simon Krajewski 10 rokov pred
rodič
commit
9813a60478
2 zmenil súbory, kde vykonal 4 pridanie a 22 odobranie
  1. 0 20
      tests/unit/src/unit/issues/Issue3616.hx
  2. 4 2
      typer.ml

+ 0 - 20
tests/unit/src/unit/issues/Issue3616.hx

@@ -1,20 +0,0 @@
-package unit.issues;
-
-private abstract A(Int) {
-    public static function f(v:Int):Void {}
-    public static function z():Void {}
-}
-
-private abstract B<T>(T) {
-    public static function f<T>(v:T):B<T> return cast v;
-}
-
-class Issue3616 extends Test {
-	function test() {
-        var v:A = null;
-		eq(unit.TestType.typeErrorText(v.f(1)), "Invalid call to static function f through abstract instance");
-
-		var v = B.f(10);
-		eq(unit.TestType.typeErrorText(v.f()), "Invalid call to static function f through abstract instance");
-	}
-}

+ 4 - 2
typer.ml

@@ -1589,9 +1589,11 @@ 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, _ ->