test for typer error message: different keys
This commit is contained in:
parent
e919a1eba3
commit
2a11c6d180
@ -9,3 +9,7 @@ let%expect_test _ =
|
|||||||
|
|
||||||
run_ligo_bad [ "compile-contract" ; "../../test/contracts/error_typer_3.mligo" ; "foo" ] ;
|
run_ligo_bad [ "compile-contract" ; "../../test/contracts/error_typer_3.mligo" ; "foo" ] ;
|
||||||
[%expect {| ligo: in file "error_typer_3.mligo", line 3, characters 34-53. tuples have different sizes: Expected these two types to be the same, but they're different (both are tuples, but with a different number of arguments) {"a":"tuple[int , string , bool]","b":"tuple[int , string]"} |} ] ;
|
[%expect {| ligo: in file "error_typer_3.mligo", line 3, characters 34-53. tuples have different sizes: Expected these two types to be the same, but they're different (both are tuples, but with a different number of arguments) {"a":"tuple[int , string , bool]","b":"tuple[int , string]"} |} ] ;
|
||||||
|
|
||||||
|
run_ligo_bad [ "compile-contract" ; "../../test/contracts/error_typer_4.mligo" ; "foo" ] ;
|
||||||
|
[%expect {| ligo: in file "error_typer_4.mligo", line 4, characters 17-56. different keys in record: {"key_a":"d","key_b":"c"} |} ] ;
|
||||||
|
|
||||||
|
7
src/test/contracts/error_typer_4.mligo
Normal file
7
src/test/contracts/error_typer_4.mligo
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
type toto = { a : int ; b : string ; c : bool }
|
||||||
|
type tata = { a : int ; d : string ; c : bool }
|
||||||
|
|
||||||
|
let foo : tata = ({a = 1 ; b = "foo" ; c = true} : toto)
|
||||||
|
|
||||||
|
let main (p:int) (storage : int) =
|
||||||
|
(([] : operation list) , p + foo.a)
|
Loading…
Reference in New Issue
Block a user