From 24972fe223c2b0b1fe65e093df04023ecbfcced5 Mon Sep 17 00:00:00 2001 From: Gaith Hallak Date: Tue, 31 May 2022 00:33:56 +0400 Subject: [PATCH] Test all cases for bivariant --- test/aeso_compiler_tests.erl | 46 +++++++++---------- ...rphism_variance_switching_custom_types.aes | 6 ++- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/test/aeso_compiler_tests.erl b/test/aeso_compiler_tests.erl index a67134d..119fb63 100644 --- a/test/aeso_compiler_tests.erl +++ b/test/aeso_compiler_tests.erl @@ -905,55 +905,55 @@ failing_contracts() -> < Cat) => dt_inv(Cat)`\nto arguments\n `f_c_to_a : (Cat) => Animal`">>, - <>, <>, + <>, - <>, <>, + <>, - <>, - <>, - <>, - <>, - <>, - <>, - <>, <>, + <>, + <>, - <>, - <>, <>, + "when checking the type of the expression `DT_A_CONTRA_B_CONTRA(f_c_to_c_to_u) : dt_a_contra_b_contra(Cat, Cat)` against the expected type `dt_a_contra_b_contra(Animal, Cat)`">>, <>, + <>, - <> ]) diff --git a/test/contracts/polymorphism_variance_switching_custom_types.aes b/test/contracts/polymorphism_variance_switching_custom_types.aes index d47472c..fef1cf5 100644 --- a/test/contracts/polymorphism_variance_switching_custom_types.aes +++ b/test/contracts/polymorphism_variance_switching_custom_types.aes @@ -71,8 +71,10 @@ main contract Main = let vc7 : dt_inv(Cat) = DT_INV(f_c_to_a) // fail let vc8 : dt_inv(Cat) = DT_INV(f_c_to_c) // success - let vd1 : dt_biv(Animal) = DT_BIV(f_u_to_u) : dt_biv(Cat) // success - let vd2 : dt_biv(Cat) = DT_BIV(f_u_to_u) : dt_biv(Animal) // success + let vd1 : dt_biv(Animal) = DT_BIV(f_u_to_u) : dt_biv(Animal) // success + let vd2 : dt_biv(Animal) = DT_BIV(f_u_to_u) : dt_biv(Cat) // success + let vd3 : dt_biv(Cat) = DT_BIV(f_u_to_u) : dt_biv(Animal) // success + let vd4 : dt_biv(Cat) = DT_BIV(f_u_to_u) : dt_biv(Cat) // success let ve1 : dt_inv_sep(Animal) = DT_INV_SEP_A(f_a_to_u) // success let ve2 : dt_inv_sep(Animal) = DT_INV_SEP_A(f_c_to_u) // fail