浏览代码

no "null" access in untyped mode.

Nicolas Cannasse 19 年之前
父节点
当前提交
fa95081f76
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      typer.ml

+ 3 - 3
typer.ml

@@ -169,11 +169,11 @@ let mk_infos ctx p params =
 let field_access ctx get f t e p =
 	match if get then f.cf_get else f.cf_set with
 	| NoAccess ->
+		let normal = AccExpr (mk (TField (e,f.cf_name)) t p) in
 		(match follow e.etype with
-		| TInst (c,_) when is_parent c ctx.curclass ->
-			AccExpr (mk (TField (e,f.cf_name)) t p)
+		| TInst (c,_) when is_parent c ctx.curclass -> normal			
 		| _ ->
-			AccNo f.cf_name)
+			if ctx.untyped then normal else AccNo f.cf_name)
 	| NormalAccess ->
 		AccExpr (mk (TField (e,f.cf_name)) t p)
 	| MethodAccess m ->