浏览代码

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

Alexander Kuzmenko 8 年之前
父节点
当前提交
b29fe48d6e
共有 1 个文件被更改,包括 1 次插入1 次删除
  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