From c23827e8de9c3405111c7460e5d38f7119401cc0 Mon Sep 17 00:00:00 2001 From: Pierre-Emmanuel Wulfman Date: Tue, 3 Mar 2020 17:45:59 +0100 Subject: [PATCH] new negative test --- src/bin/expect_tests/typer_error_tests.ml | 13 +++++++++++++ .../negative/error_function_annotation_3.mligo | 9 +++++++++ 2 files changed, 22 insertions(+) create mode 100644 src/test/contracts/negative/error_function_annotation_3.mligo diff --git a/src/bin/expect_tests/typer_error_tests.ml b/src/bin/expect_tests/typer_error_tests.ml index a9b5ce6f2..48d53bcbd 100644 --- a/src/bin/expect_tests/typer_error_tests.ml +++ b/src/bin/expect_tests/typer_error_tests.ml @@ -19,6 +19,19 @@ let%expect_test _ = ligo: in file "error_function_annotation_2.mligo", line 1, characters 14-43. different kinds: {"a":"int","b":"( int * int ) -> int"} + If you're not sure how to fix this error, you can + do one of the following: + + * Visit our documentation: https://ligolang.org/docs/intro/what-and-why/ + * Ask a question on our Discord: https://discord.gg/9rhYaEt + * Open a gitlab issue: https://gitlab.com/ligolang/ligo/issues/new + * Check the changelog by running 'ligo changelog' |}]; + + run_ligo_bad [ "compile-contract" ; "../../test/contracts/negative/error_function_annotation_3.mligo"; "f"]; + [%expect {| + ligo: in file "", line 0, characters 0-0. different kinds: {"a":"( (TO_list(operation)) * sum[Add -> int , Sub -> int] )","b":"sum[Add -> int , Sub -> int]"} + + If you're not sure how to fix this error, you can do one of the following: diff --git a/src/test/contracts/negative/error_function_annotation_3.mligo b/src/test/contracts/negative/error_function_annotation_3.mligo new file mode 100644 index 000000000..28d1e0e42 --- /dev/null +++ b/src/test/contracts/negative/error_function_annotation_3.mligo @@ -0,0 +1,9 @@ +type op = + | Add of int + | Sub of int + + +let main (p,s : int * op) : (operation list) * op = + match s with + | Add si -> Add si + | Sub si -> Sub si