From 290b9326e387a231932dc93af1273bd8a5b9dbc1 Mon Sep 17 00:00:00 2001 From: Daniel Kirchner Date: Thu, 10 Feb 2022 13:38:17 +0100 Subject: [PATCH] Move stray semantics test to proper directory. --- .../constructor_inheritance_init_order_3_legacy.sol} | 6 +++--- .../constructor_inheritance_init_order_3_viaIR.sol | 12 ++++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) rename test/libsolidity/{constructor_inheritance_init_order_3.sol => semanticTests/constructor_inheritance_init_order_3_legacy.sol} (54%) create mode 100644 test/libsolidity/semanticTests/constructor_inheritance_init_order_3_viaIR.sol diff --git a/test/libsolidity/constructor_inheritance_init_order_3.sol b/test/libsolidity/semanticTests/constructor_inheritance_init_order_3_legacy.sol similarity index 54% rename from test/libsolidity/constructor_inheritance_init_order_3.sol rename to test/libsolidity/semanticTests/constructor_inheritance_init_order_3_legacy.sol index c9719a108..d9bed3f54 100644 --- a/test/libsolidity/constructor_inheritance_init_order_3.sol +++ b/test/libsolidity/semanticTests/constructor_inheritance_init_order_3_legacy.sol @@ -1,12 +1,12 @@ contract A { - uint public x; + uint public x = 2; constructor(uint) {} - function f() public { x = 4; } + function f() public returns(uint) { x = 4; } } contract B is A { constructor() A(f()) {} } // ==== -// compileViaYul: also +// compileViaYul: false // ---- // x() -> 4 diff --git a/test/libsolidity/semanticTests/constructor_inheritance_init_order_3_viaIR.sol b/test/libsolidity/semanticTests/constructor_inheritance_init_order_3_viaIR.sol new file mode 100644 index 000000000..0d582f8d7 --- /dev/null +++ b/test/libsolidity/semanticTests/constructor_inheritance_init_order_3_viaIR.sol @@ -0,0 +1,12 @@ +contract A { + uint public x = 2; + constructor(uint) {} + function f() public returns(uint) { x = 4; } +} +contract B is A { + constructor() A(f()) {} +} +// ==== +// compileViaYul: true +// ---- +// x() -> 2