From a87eb36778900f087105ad553325f12aca35b0d8 Mon Sep 17 00:00:00 2001 From: Gaith Hallak Date: Wed, 3 Aug 2022 19:59:12 +0400 Subject: [PATCH] Update the tests --- test/aeso_compiler_tests.erl | 15 ++++++++++++++- ...ymorphism_variance_switching_chain_create.aes} | 9 +++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) rename test/contracts/{polymorphism_chain_create.aes => polymorphism_variance_switching_chain_create.aes} (57%) diff --git a/test/aeso_compiler_tests.erl b/test/aeso_compiler_tests.erl index d2fb5b6..ad45982 100644 --- a/test/aeso_compiler_tests.erl +++ b/test/aeso_compiler_tests.erl @@ -202,7 +202,6 @@ compilable_contracts() -> "polymorphism_contract_interface_extensions", "polymorphism_contract_interface_same_decl_multi_interface", "polymorphism_contract_interface_same_name_same_type", - "polymorphism_chain_create", "missing_init_fun_state_unit", "complex_compare_leq", "complex_compare", @@ -1026,6 +1025,20 @@ failing_contracts() -> "Cannot unify `Animal` and `Cat` in a covariant context\n" "when checking the type of the pattern `q15 : oracle_query(Cat, Cat)` against the expected type `oracle_query(Cat, Animal)`">> ]) + , ?TYPE_ERROR(polymorphism_variance_switching_chain_create, + [<>, + <>, + <>, + <> + ]) , ?TYPE_ERROR(missing_definition, [<> diff --git a/test/contracts/polymorphism_chain_create.aes b/test/contracts/polymorphism_variance_switching_chain_create.aes similarity index 57% rename from test/contracts/polymorphism_chain_create.aes rename to test/contracts/polymorphism_variance_switching_chain_create.aes index 78fe9c8..69c11c2 100644 --- a/test/contracts/polymorphism_chain_create.aes +++ b/test/contracts/polymorphism_variance_switching_chain_create.aes @@ -21,3 +21,12 @@ main contract Main = stateful entrypoint test2() = let c = Make.new2() Make.new(c) + + stateful entrypoint test3() = + let c1 : I = Chain.create() // fails + let c2 : C1 = Chain.create() : I // fails + let c3 = Chain.create() : I // fails + let c4 = Chain.create() : C1 // succeeds + let c5 : I = Chain.create() : C1 // succeeds + let c6 : C1 = Chain.create() // succeeds + ()