Quellcode durchsuchen

allow call to abstract 'this' because the underlying type could be a function

Simon Krajewski vor 12 Jahren
Ursprung
Commit
293f126d3c
1 geänderte Dateien mit 2 neuen und 5 gelöschten Zeilen
  1. 2 5
      typer.ml

+ 2 - 5
typer.ml

@@ -962,11 +962,8 @@ let rec type_ident_raise ?(imported_enums=true) ctx i p mode =
 			| Method _ when ctx.curfield.cf_name = "_new" -> ()
 			| _ -> error "You can only modify 'this' inside an inline function" p);
 			AKExpr (get_this ctx p)
-		| _ ->
-		if mode = MGet then
-			AKExpr (get_this ctx p)
-		else
-			AKNo i)
+		| (MCall, KAbstractImpl _) | (MGet, _)-> AKExpr(get_this ctx p)
+		| _ -> AKNo i)
 	| "super" ->
 		let t = (match ctx.curclass.cl_super with
 			| None -> error "Current class does not have a superclass" p