From 08d54f274a600c38c2a2d52121b198dd2a46e29b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=9Aliwak?= Date: Wed, 22 Mar 2023 11:59:26 +0100 Subject: [PATCH] Tests for recursive suffix calls --- .../recursive_suffix_application.sol | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/libsolidity/semanticTests/literalSuffixes/recursive_suffix_application.sol diff --git a/test/libsolidity/semanticTests/literalSuffixes/recursive_suffix_application.sol b/test/libsolidity/semanticTests/literalSuffixes/recursive_suffix_application.sol new file mode 100644 index 000000000..3840dce59 --- /dev/null +++ b/test/libsolidity/semanticTests/literalSuffixes/recursive_suffix_application.sol @@ -0,0 +1,16 @@ +function double(uint x) pure suffix returns (uint) { + if (x == 0) + return 0; + if (x == 1) + return 0 double + 2; + else + return 1 double * x; +} + +contract C { + function test() public pure returns (uint) { + return 10 double; + } +} +// ---- +// test() -> 20