Browse Source

Merge pull request #4780 from HaxeFoundation/add_macro_class_path

Compiler.addClassPath: Also add the class path to the macro context
Simon Krajewski 9 years ago
parent
commit
eca032ad01
1 changed files with 7 additions and 1 deletions
  1. 7 1
      interp.ml

+ 7 - 1
interp.ml

@@ -2615,7 +2615,13 @@ let macro_lib =
 			match v with
 			| VString cp ->
 				let com = ccom() in
-				com.class_path <- (Common.normalize_path cp) :: com.class_path;
+				let norm_path = Common.normalize_path cp in
+				com.class_path <- norm_path :: com.class_path;
+				(match com.get_macros() with
+					| Some(mcom) ->
+						mcom.class_path <- norm_path :: com.class_path;
+					| None ->
+						());
 				Hashtbl.clear com.file_lookup_cache;
 				VNull
 			| _ ->