From 25292cd77bf9741785f797a1e5a7bc99fe7af06d Mon Sep 17 00:00:00 2001 From: wechman Date: Tue, 27 Sep 2022 10:13:02 +0200 Subject: [PATCH] Only operator defined as global is transitive through imports test case --- ...s_global_is_transitive_through_imports.sol | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 test/libsolidity/semanticTests/operators/custom/only_operator_defined_as_global_is_transitive_through_imports.sol diff --git a/test/libsolidity/semanticTests/operators/custom/only_operator_defined_as_global_is_transitive_through_imports.sol b/test/libsolidity/semanticTests/operators/custom/only_operator_defined_as_global_is_transitive_through_imports.sol new file mode 100644 index 000000000..2a23c0499 --- /dev/null +++ b/test/libsolidity/semanticTests/operators/custom/only_operator_defined_as_global_is_transitive_through_imports.sol @@ -0,0 +1,26 @@ +==== Source: s1.sol ==== +type Int is int; +using {add1 as +} for Int global; + +function add1(Int, Int) pure returns (Int) { + return Int.wrap(3); +} + +==== Source: s2.sol ==== +import "s1.sol"; +using {add2 as +} for Int; + +function add2(Int, Int) pure returns (Int) { + return Int.wrap(7); +} + +==== Source: s3.sol ==== +import "s2.sol"; +contract C { + function f() pure public returns (Int) { + return Int.wrap(0) + Int.wrap(0); + } +} + +// ---- +// f() -> 3