浏览代码

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

Simon Krajewski 9 年之前
父节点
当前提交
5e5ace2187
共有 1 个文件被更改,包括 3 次插入0 次删除
  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