Add tests
This commit is contained in:
parent
8b2fdd5ab9
commit
c3f057c438
@ -795,6 +795,14 @@ failing_contracts() ->
|
|||||||
[<<?Pos(2,5)
|
[<<?Pos(2,5)
|
||||||
"Empty record definitions are not allowed. Cannot define the record `r`">>
|
"Empty record definitions are not allowed. Cannot define the record `r`">>
|
||||||
])
|
])
|
||||||
|
, ?TYPE_ERROR(operator_lambdas,
|
||||||
|
[<<?Pos(9,32)
|
||||||
|
"Cannot unify `(int, int) => int` and `(int) => 'a`\n"
|
||||||
|
"when checking the application of\n"
|
||||||
|
" `(l : _, r : _) => l + r : (int, int) => int`\n"
|
||||||
|
"to arguments\n"
|
||||||
|
" `1 : int`">>
|
||||||
|
])
|
||||||
, ?TYPE_ERROR(warnings,
|
, ?TYPE_ERROR(warnings,
|
||||||
[<<?Pos(0, 0)
|
[<<?Pos(0, 0)
|
||||||
"The file `Triple.aes` is included but not used.">>,
|
"The file `Triple.aes` is included but not used.">>,
|
||||||
|
14
test/contracts/operator_lambdas.aes
Normal file
14
test/contracts/operator_lambdas.aes
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
include "List.aes"
|
||||||
|
|
||||||
|
contract C =
|
||||||
|
type state = int
|
||||||
|
|
||||||
|
function sum(l : list(bool)) : bool = List.foldl((||), false, l)
|
||||||
|
|
||||||
|
entrypoint init() =
|
||||||
|
let bad_application = (+)(1)
|
||||||
|
let good_application = (-)(3, 4)
|
||||||
|
let op_var = (+)
|
||||||
|
let op_var_application = op_var(3, 4)
|
||||||
|
|
||||||
|
good_application + op_var_application
|
Loading…
x
Reference in New Issue
Block a user