From 6ebefdd1f894d532e6c38d29d3e5a8896a62a057 Mon Sep 17 00:00:00 2001 From: wechman Date: Tue, 9 Aug 2022 11:52:22 +0200 Subject: [PATCH] Add test for external call inside operator function --- ...external_call_inside_operator_function.sol | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/libsolidity/semanticTests/operators/custom/external_call_inside_operator_function.sol diff --git a/test/libsolidity/semanticTests/operators/custom/external_call_inside_operator_function.sol b/test/libsolidity/semanticTests/operators/custom/external_call_inside_operator_function.sol new file mode 100644 index 000000000..d82f9ccb3 --- /dev/null +++ b/test/libsolidity/semanticTests/operators/custom/external_call_inside_operator_function.sol @@ -0,0 +1,24 @@ +type Int is int16; + +using {add as +} for Int; + + +function add(Int, Int) returns (Int) { + B b = new B(); + return b.f(); +} + +contract B { + function f() pure external returns (Int) { + return Int.wrap(3); + } +} + +contract C { + function test() public returns (Int) { + return Int.wrap(0) + Int.wrap(0); + } +} + +// ---- +// test() -> 3