Explorar o código

pattern matcher fix, also avoid unit test problems (we still have to find out what's wrong there though)

Simon Krajewski %!s(int64=12) %!d(string=hai) anos
pai
achega
5991d1e5dd
Modificáronse 2 ficheiros con 2 adicións e 2 borrados
  1. 1 1
      matcher.ml
  2. 1 1
      tests/unit/TestMeta.hx

+ 1 - 1
matcher.ml

@@ -865,7 +865,7 @@ let match_expr ctx e cases def need_val with_type p =
 	let a = List.length evals in
 	let a = List.length evals in
 	let stl = ExtList.List.mapi (fun i e ->
 	let stl = ExtList.List.mapi (fun i e ->
 		let rec loop e = match e.eexpr with
 		let rec loop e = match e.eexpr with
-			| TField (ef,s) ->
+			| TField (ef,s) when (match s with FEnum _ -> false | _ -> true) ->
 				mk_st (SField(loop ef,field_name s)) e.etype e.epos
 				mk_st (SField(loop ef,field_name s)) e.etype e.epos
 			| TParenthesis e ->
 			| TParenthesis e ->
 				loop e
 				loop e

+ 1 - 1
tests/unit/TestMeta.hx

@@ -70,7 +70,7 @@ package unit;
 
 
 	@:macro static function getMeta(e) {
 	@:macro static function getMeta(e) {
 		switch(e.expr) {
 		switch(e.expr) {
-			case haxe.macro.Expr.ExprDef.EMeta(m, _):
+			case EMeta(m, _):
 				return macro { name: $(m.name), args: $[m.params] };
 				return macro { name: $(m.name), args: $[m.params] };
 			default:
 			default:
 				return macro report("Metadata expected");
 				return macro report("Metadata expected");