Fix compiler crash on missing let body

This commit is contained in:
Ulf Norell
2019-06-21 14:16:26 +02:00
parent d38367e023
commit 7fa98892a8
3 changed files with 34 additions and 4 deletions
+5 -1
View File
@@ -208,7 +208,11 @@ failing_contracts() ->
<<"Repeated argument y to function repeated_arg (at line 44, column 12).">>,
<<"No record type with fields y, z (at line 14, column 22)">>,
<<"The field z is missing when constructing an element of type r2 (at line 15, column 24)">>,
<<"Record type r2 does not have field y (at line 15, column 22)">>]}
<<"Record type r2 does not have field y (at line 15, column 22)">>,
<<"Let binding at line 47, column 5 must be followed by an expression">>,
<<"Let binding at line 50, column 5 must be followed by an expression">>,
<<"Let binding at line 54, column 5 must be followed by an expression">>,
<<"Let binding at line 58, column 5 must be followed by an expression">>]}
, {"init_type_error",
[<<"Cannot unify string\n"
" and map(int, int)\n"
+15
View File
@@ -42,3 +42,18 @@ contract Test =
set_x(set_x(x, r), x)
function repeated_arg(x : int, y, x : string, y : bool) : string = x
function missing1() =
let x = 0
function missing_fun1() =
let f(x) = x
function missing2() =
let x = 0
let y = 0
function missing_fun2() =
let f() = 0
let g() = f()