瀏覽代碼

allow access to all public fields of the underlying type inside an abstract

Simon Krajewski 12 年之前
父節點
當前提交
17ee33c8fb
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      typer.ml

+ 4 - 0
typer.ml

@@ -1038,6 +1038,10 @@ and type_field ctx e i p mode =
 			AKUsing ((mk (TField (et,FStatic (c,f))) t p),c,f,e)
 		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;
+			| _ -> raise Not_found)
 		with Not_found ->
 			no_field())
 	| _ ->