浏览代码

allow access to fields of underlying types only on "this"

Simon Krajewski 12 年之前
父节点
当前提交
57784e9974
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      typer.ml

+ 2 - 2
typer.ml

@@ -1202,8 +1202,8 @@ and type_field ctx e i p mode =
 		with Not_found -> try
 			using_field ctx mode e i p
 		with Not_found -> try
-			(match ctx.curclass.cl_kind with
-			| KAbstractImpl a2 when a == a2 -> type_field ctx {e with etype = apply_params a.a_types pl a.a_this} i p mode;
+			(match ctx.curfun, e.eexpr with
+			| FunMemberAbstract, TConst (TThis) -> type_field ctx {e with etype = apply_params a.a_types pl a.a_this} i p mode;
 			| _ -> raise Not_found)
 		with Not_found ->
 			no_field())