From 88666a36d2a6b81d6d99757f8b702f804f3eb16c Mon Sep 17 00:00:00 2001 From: Gaith Hallak Date: Sat, 18 Dec 2021 19:20:45 +0200 Subject: [PATCH] Add tests for interfaces implementing interfaces --- test/aeso_compiler_tests.erl | 10 ++++++++++ ...interface_polymorphism_same_name_different_type.aes | 9 +++++++++ ...ract_interface_polymorphism_same_name_same_type.aes | 8 ++++++++ 3 files changed, 27 insertions(+) create mode 100644 test/contracts/contract_interface_polymorphism_same_name_different_type.aes create mode 100644 test/contracts/contract_interface_polymorphism_same_name_same_type.aes diff --git a/test/aeso_compiler_tests.erl b/test/aeso_compiler_tests.erl index 192da86..7e8f2f0 100644 --- a/test/aeso_compiler_tests.erl +++ b/test/aeso_compiler_tests.erl @@ -836,6 +836,16 @@ failing_contracts() -> [<> ]) + , ?TYPE_ERROR(contract_interface_polymorphism_same_name_same_type, + [<> + ]) + , ?TYPE_ERROR(contract_interface_polymorphism_same_name_different_type, + [<> + ]) , ?TYPE_ERROR(contract_polymorphism_missing_implementation, [<> diff --git a/test/contracts/contract_interface_polymorphism_same_name_different_type.aes b/test/contracts/contract_interface_polymorphism_same_name_different_type.aes new file mode 100644 index 0000000..d324c11 --- /dev/null +++ b/test/contracts/contract_interface_polymorphism_same_name_different_type.aes @@ -0,0 +1,9 @@ +contract interface I1 = + entrypoint f : () => int + +contract interface I2 : I1 = + entrypoint f : () => char + +contract C : I2 = + entrypoint f() = 1 + entrypoint f() = 'c' diff --git a/test/contracts/contract_interface_polymorphism_same_name_same_type.aes b/test/contracts/contract_interface_polymorphism_same_name_same_type.aes new file mode 100644 index 0000000..20ab99f --- /dev/null +++ b/test/contracts/contract_interface_polymorphism_same_name_same_type.aes @@ -0,0 +1,8 @@ +contract interface I1 = + entrypoint f : () => int + +contract interface I2 : I1 = + entrypoint f : () => int + +contract C : I2 = + entrypoint f() = 1