Browse Source

fixed macro+using

Nicolas Cannasse 14 years ago
parent
commit
d995ccbb61
1 changed files with 6 additions and 1 deletions
  1. 6 1
      typer.ml

+ 6 - 1
typer.ml

@@ -1688,7 +1688,12 @@ and type_call ctx e el p =
 				(match type_field ctx ec ef.cf_name p MCall with
 				(match type_field ctx ec ef.cf_name p MCall with
 				| AKMacro _ ->
 				| AKMacro _ ->
 					(match ec.eexpr with
 					(match ec.eexpr with
-					| TTypeExpr (TClassDecl c) ->						
+					| TTypeExpr (TClassDecl c) ->
+						let e = (match fst e with
+							| EField (e,f) -> if f <> ef.cf_name then assert false; e
+							| EConst (Ident f | Type f) -> if f <> ef.cf_name then assert false; (EConst (Ident "this"),snd e)
+							| _ -> error "Unsupported" (snd e)
+						) in
 						(match ctx.g.do_macro ctx c.cl_path ef.cf_name (e :: el) p with
 						(match ctx.g.do_macro ctx c.cl_path ef.cf_name (e :: el) p with
 						| None -> type_expr ctx (EConst (Ident "null"),p)
 						| None -> type_expr ctx (EConst (Ident "null"),p)
 						| Some e -> type_expr ctx e)
 						| Some e -> type_expr ctx e)