Răsfoiți Sursa

[php7] Generate `Std.is(this, SomeType)` as `this instanceof SomeType`

Alexander Kuzmenko 8 ani în urmă
părinte
comite
b29fe48d6e
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      src/generators/genphp7.ml

+ 1 - 1
src/generators/genphp7.ml

@@ -832,7 +832,7 @@ let instanceof_compatible (subject_arg:texpr) (type_arg:texpr) : bool =
 		| TTypeExpr (TClassDecl { cl_path = path }) when path <> ([], "String") && path <> ([], "Class") ->
 			let subject_arg = reveal_expr_with_parenthesis subject_arg in
 			(match subject_arg.eexpr with
-				| TLocal _ | TField _ | TCall _ | TArray _ -> not (is_magic subject_arg)
+				| TLocal _ | TField _ | TCall _ | TArray _ | TConst TThis -> not (is_magic subject_arg)
 				| _ -> false
 			)
 		| _ -> false