|
@@ -67,6 +67,8 @@ type access_kind =
|
|
|
| AKUsing of texpr * tclass * tclass_field * texpr
|
|
|
| AKAccess of tabstract * tparams * tclass * texpr * texpr
|
|
|
|
|
|
+let build_call_ref : (typer -> access_kind -> expr list -> with_type -> pos -> texpr) ref = ref (fun _ _ _ _ _ -> assert false)
|
|
|
+
|
|
|
let mk_infos ctx p params =
|
|
|
let file = if ctx.in_macro then p.pfile else if Common.defined ctx.com Define.AbsolutePath then Common.get_full_path p.pfile else Filename.basename p.pfile in
|
|
|
(EObjectDecl (
|
|
@@ -1617,6 +1619,14 @@ and type_field ?(resume=false) ctx e i p mode =
|
|
|
(match ctx.curfun, e.eexpr with
|
|
|
| FunMemberAbstract, TConst (TThis) -> type_field ctx {e with etype = apply_params a.a_params pl a.a_this} i p mode;
|
|
|
| _ -> raise Not_found)
|
|
|
+(* with Not_found -> try
|
|
|
+ let c = (match a.a_impl with None -> raise Not_found | Some c -> c) in
|
|
|
+ let cf = PMap.find "resolve" c.cl_statics in
|
|
|
+ if not (Meta.has Meta.Resolve cf.cf_meta) then raise Not_found;
|
|
|
+ let et = type_module_type ctx (TClassDecl c) None p in
|
|
|
+ let t = apply_params a.a_params pl (field_type ctx c [] cf p) in
|
|
|
+ let ef = mk (TField (et,FStatic (c,cf))) t p in
|
|
|
+ AKExpr ((!build_call_ref) ctx (AKUsing(ef,c,cf,e)) [EConst (String i),p] NoValue p) *)
|
|
|
with Not_found ->
|
|
|
if !static_abstract_access_through_instance then error ("Invalid call to static function " ^ i ^ " through abstract instance") p
|
|
|
else no_field())
|
|
@@ -4914,4 +4924,5 @@ make_call_ref := make_call;
|
|
|
get_constructor_ref := get_constructor;
|
|
|
cast_or_unify_ref := Codegen.AbstractCast.cast_or_unify_raise;
|
|
|
type_module_type_ref := type_module_type;
|
|
|
-find_array_access_raise_ref := Codegen.AbstractCast.find_array_access_raise
|
|
|
+find_array_access_raise_ref := Codegen.AbstractCast.find_array_access_raise;
|
|
|
+build_call_ref := build_call
|