Test case for function application source location

This commit is contained in:
Ulf Norell 2019-09-14 12:12:55 +02:00
parent 11d998b739
commit 981027b2e7
2 changed files with 13 additions and 1 deletions

View File

@ -301,7 +301,14 @@ failing_contracts() ->
<<?Pos(54, 5) <<?Pos(54, 5)
"Let binding at line 54, column 5 must be followed by an expression">>, "Let binding at line 54, column 5 must be followed by an expression">>,
<<?Pos(58, 5) <<?Pos(58, 5)
"Let binding at line 58, column 5 must be followed by an expression">>]) "Let binding at line 58, column 5 must be followed by an expression">>,
<<?Pos(63, 5)
"Cannot unify int\n"
" and bool\n"
"when checking the type of the expression at line 63, column 5\n"
" id(n) : int\n"
"against the expected type\n"
" bool">>])
, ?TYPE_ERROR(init_type_error, , ?TYPE_ERROR(init_type_error,
[<<?Pos(7, 3) [<<?Pos(7, 3)
"Cannot unify string\n" "Cannot unify string\n"

View File

@ -57,3 +57,8 @@ contract Test =
let f() = 0 let f() = 0
let g() = f() let g() = f()
function id(x : 'a) : 'a = x
entrypoint wrong_return(n : int) : bool =
id(n)