2
0
Эх сурвалжийг харах

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

Simon Krajewski 12 жил өмнө
parent
commit
293f126d3c
1 өөрчлөгдсөн 2 нэмэгдсэн , 5 устгасан
  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" -> ()
 			| Method _ when ctx.curfield.cf_name = "_new" -> ()
 			| _ -> error "You can only modify 'this' inside an inline function" p);
 			| _ -> error "You can only modify 'this' inside an inline function" p);
 			AKExpr (get_this ctx 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" ->
 	| "super" ->
 		let t = (match ctx.curclass.cl_super with
 		let t = (match ctx.curclass.cl_super with
 			| None -> error "Current class does not have a superclass" p
 			| None -> error "Current class does not have a superclass" p