summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKathy Gray2013-10-14 14:57:01 +0100
committerKathy Gray2013-10-14 14:57:01 +0100
commitac043de5e194cad8a5b07d288d4c42ff17b18214 (patch)
tree7921712e7983aa626fecbc0ff8163d4ebf59cfa5 /src
parent14d544935fc87df2b258cd4c9ed5acede44fe1f3 (diff)
Fix pattern match so that P_id is selected when P_app has no parameters
Diffstat (limited to 'src')
-rw-r--r--src/initial_check.ml5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/initial_check.ml b/src/initial_check.ml
index c36627ec..82c975c4 100644
--- a/src/initial_check.ml
+++ b/src/initial_check.ml
@@ -288,7 +288,10 @@ let rec to_ast_pat (k_env : kind Envmap.t) (Parse_ast.P_aux(pat,l) : Parse_ast.p
| Parse_ast.P_as(pat,id) -> P_as(to_ast_pat k_env pat,to_ast_id id)
| Parse_ast.P_typ(typ,pat) -> P_typ(to_ast_typ k_env typ,to_ast_pat k_env pat)
| Parse_ast.P_id(id) -> P_id(to_ast_id id)
- | Parse_ast.P_app(id,pats) -> P_app(to_ast_id id, List.map (to_ast_pat k_env) pats)
+ | Parse_ast.P_app(id,pats) ->
+ if pats = []
+ then P_id (to_ast_id id)
+ else P_app(to_ast_id id, List.map (to_ast_pat k_env) pats)
| Parse_ast.P_record(fpats,_) -> P_record(List.map
(fun (Parse_ast.FP_aux(Parse_ast.FP_Fpat(id,fp),l)) -> FP_aux(FP_Fpat(to_ast_id id, to_ast_pat k_env fp),(l,None)))
fpats, false)