Prechádzať zdrojové kódy

remove unused `ctx.in_super_call`

Simon Krajewski 9 rokov pred
rodič
commit
e6b7a598af
3 zmenil súbory, kde vykonal 1 pridanie a 7 odobranie
  1. 0 1
      typecore.ml
  2. 0 1
      typeload.ml
  3. 1 5
      typer.ml

+ 0 - 1
typecore.ml

@@ -106,7 +106,6 @@ and typer = {
 	(* per-function *)
 	mutable curfield : tclass_field;
 	mutable untyped : bool;
-	mutable in_super_call : bool;
 	mutable in_loop : bool;
 	mutable in_display : bool;
 	mutable in_macro : bool;

+ 0 - 1
typeload.ml

@@ -3259,7 +3259,6 @@ let type_types_into_module ctx m tdecls p =
 		type_params = [];
 		curfun = FunStatic;
 		untyped = false;
-		in_super_call = false;
 		in_macro = ctx.in_macro;
 		in_display = false;
 		in_loop = false;

+ 1 - 5
typer.ml

@@ -1350,7 +1350,6 @@ let rec type_ident_raise ?(imported_enums=true) ctx i p mode =
 		| FunMemberAbstract -> error "Cannot access super inside an abstract function" p
 		| FunStatic -> error "Cannot access super inside a static function" p;
 		| FunMemberClassLocal | FunMemberAbstractLocal -> error "Cannot access super inside a local function" p);
-		if mode <> MSet && ctx.in_super_call then ctx.in_super_call <- false;
 		AKExpr (mk (TConst TSuper) t p)
 	| "null" ->
 		if mode = MGet then
@@ -4093,9 +4092,7 @@ and handle_display ctx e_ast iscall with_type p =
 
 
 and type_call ctx e el (with_type:with_type) p =
-	let def () = (match e with
-		| EField ((EConst (Ident "super"),_),_) , _ -> ctx.in_super_call <- true
-		| _ -> ());
+	let def () =
 		build_call ctx (type_access ctx (fst e) (snd e) MCall) el with_type p
 	in
 	match e, el with
@@ -5222,7 +5219,6 @@ let rec create com =
 		untyped = false;
 		curfun = FunStatic;
 		in_loop = false;
-		in_super_call = false;
 		in_display = false;
 		in_macro = Common.defined com Define.Macro;
 		ret = mk_mono();