From 5bc5f5dee8921f8d24260dae54177e00c291fcb1 Mon Sep 17 00:00:00 2001 From: Alasdair Armstrong Date: Mon, 10 Dec 2018 20:39:16 +0000 Subject: Various changes: * Improve type inference for numeric if statements (if_infer test) * Correctly handle constraints for existentially quantified constructors (constraint_ctor test) * Canonicalise all numeric types in function arguments, which triggers some weird edge cases between parametric polymorphism and subtyping of numeric arguments * Because of this eq_int, eq_range, and eq_atom etc become identical * Avoid duplicating destruct_exist in Env * Handle some odd subtyping cases better --- src/parser.mly | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/parser.mly') diff --git a/src/parser.mly b/src/parser.mly index fa36591c..83e6936d 100644 --- a/src/parser.mly +++ b/src/parser.mly @@ -212,9 +212,11 @@ let rec desugar_rchain chain s e = %start file %start typschm_eof +%start typ_eof %start exp_eof %start def_eof %type typschm_eof +%type typ_eof %type exp_eof %type def_eof %type file @@ -349,6 +351,10 @@ tyarg: | Lparen typ_list Rparen { [], $2 } +typ_eof: + | typ Eof + { $1 } + typ: | typ0 { $1 } -- cgit v1.2.3