From 3b3e24fb839febfba4fcb788e0aeed11894d25a8 Mon Sep 17 00:00:00 2001 From: Gaith Hallak Date: Wed, 11 May 2022 17:13:25 +0400 Subject: [PATCH] Restore test.aes --- test/aeso_compiler_tests.erl | 1 + ...ontract_polymorphism_interface_extensions.aes | 9 +++++++++ test/contracts/test.aes | 16 ++++++++++++---- 3 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 test/contracts/contract_polymorphism_interface_extensions.aes diff --git a/test/aeso_compiler_tests.erl b/test/aeso_compiler_tests.erl index 6898ed0..fc93db6 100644 --- a/test/aeso_compiler_tests.erl +++ b/test/aeso_compiler_tests.erl @@ -205,6 +205,7 @@ compilable_contracts() -> "contract_polymorphism", "contract_polymorphism_multi_interface", "contract_interface_polymorphism", + "contract_polymorphism_interface_extensions", "contract_interface_polymorphism_same_decl_multi_interface", "contract_interface_polymorphism_same_name_same_type", "test" % Custom general-purpose test file. Keep it last on the list. diff --git a/test/contracts/contract_polymorphism_interface_extensions.aes b/test/contracts/contract_polymorphism_interface_extensions.aes new file mode 100644 index 0000000..0d87481 --- /dev/null +++ b/test/contracts/contract_polymorphism_interface_extensions.aes @@ -0,0 +1,9 @@ +contract interface I0 = + entrypoint f : () => int + +contract interface I1 : I0 = + entrypoint f : () => int + entrypoint something_else : () => int + +main contract C = + entrypoint f(x : I1) = x.f() // Here we should know that x has f \ No newline at end of file diff --git a/test/contracts/test.aes b/test/contracts/test.aes index 4b100a2..d978179 100644 --- a/test/contracts/test.aes +++ b/test/contracts/test.aes @@ -1,4 +1,12 @@ -contract ShareTwo = - record state = {s1 : int, s2 : int} - entrypoint init() = {s1 = 0, s2 = 0} - stateful entrypoint buy() = () +// This is a custom test file if you need to run a compiler without +// changing aeso_compiler_tests.erl + +include "List.aes" + +contract IntegerHolder = + type state = int + entrypoint init(x) = x + entrypoint get() = state + +main contract Test = + stateful entrypoint f(c) = Chain.clone(ref=c, 123)