Browse Source

support `var n` as pattern (see #5011)

Simon Krajewski 9 years ago
parent
commit
5e5ace2187
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/typing/matcher.ml

+ 3 - 0
src/typing/matcher.ml

@@ -275,6 +275,9 @@ module Pattern = struct
 					| _ ->
 						handle_ident i
 				end
+			| EVars([s,None,None]) ->
+				let v = add_local s in
+				PatVariable v
 			| ECall(e1,el) ->
 				let e1 = type_expr ctx e1 (WithType t) in
 				begin match e1.eexpr,follow e1.etype with