Browse Source

small pattern matcher fixes

Simon Krajewski 12 years ago
parent
commit
79c09e12f9
1 changed files with 2 additions and 2 deletions
  1. 2 2
      matcher.ml

+ 2 - 2
matcher.ml

@@ -544,7 +544,7 @@ let bind_remaining (out : outcome) (stl : subterm list) (row : pattern list) =
 		| [],_ ->
 			()
 	in
-	loop stl row
+	loop (List.rev stl) (List.rev row)
 
 (* Returns an exhaustive list of all constructors for a given type *)
 (* TODO: cache this? *)
@@ -717,7 +717,7 @@ and to_enum_switch ctx need_val st en pl cases =
 		match c with
 		| CEnum(en,ef) ->
 			let save = save_locals ctx in
-			let vl = match follow (monomorphs ef.ef_params ef.ef_type) with
+			let vl = match follow (monomorphs en.e_types (monomorphs ef.ef_params ef.ef_type)) with
 			| TFun(args,r) ->
 				unify ctx r et p;
 				let vl = ExtList.List.mapi (fun i (_,_,t) ->