Skip to content
Snippets Groups Projects

Add check for non-comparable types under `set` and `ticket`

Merged E. Rivas requested to merge er433/docs/test-comparable into dev
@@ -1155,11 +1155,21 @@ let%expect_test _ =
let%expect_test _ =
run_ligo_bad [ "compile" ; "contract" ; bad_contract "not_comparable.mligo" ] ;
[%expect{| "Tezos.self" must be used directly and cannot be used via another function. |}]
[%expect{|
File "../../test/contracts/negative/not_comparable.mligo", line 1, characters 21-28:
1 | let main ((_u, s) : (int set) set * unit) : operation list * unit = ([] : operation list), s
2 |
The set constructor needs a comparable type argument, but it was given a non-comparable one. |}]
let%expect_test _ =
run_ligo_bad [ "compile" ; "contract" ; bad_contract "not_comparable.mligo" ; "-e" ; "main2" ] ;
[%expect{| "Tezos.self" must be used directly and cannot be used via another function. |}]
[%expect{|
File "../../test/contracts/negative/not_comparable.mligo", line 3, characters 22-29:
2 |
3 | let main2 ((_u, s) : (int set) ticket * unit) : operation list * unit = ([] : operation list), s
The ticket constructor needs a comparable type argument, but it was given a non-comparable one. |}]
let%expect_test _ =
run_ligo_good [ "compile" ; "storage" ; contract "big_map.ligo" ; "(big_map1,unit)" ] ;
Loading