From 56238ab1ec99176e964e55bbb657c22f92b5200b Mon Sep 17 00:00:00 2001 From: Daniel Kirchner Date: Mon, 14 May 2018 11:06:50 +0200 Subject: [PATCH] Add test for default location. --- .../storageReturn/default_location.sol | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 test/libsolidity/syntaxTests/controlFlow/storageReturn/default_location.sol diff --git a/test/libsolidity/syntaxTests/controlFlow/storageReturn/default_location.sol b/test/libsolidity/syntaxTests/controlFlow/storageReturn/default_location.sol new file mode 100644 index 000000000..9a42192de --- /dev/null +++ b/test/libsolidity/syntaxTests/controlFlow/storageReturn/default_location.sol @@ -0,0 +1,19 @@ +contract C { + struct S { bool f; } + S s; + function f() internal view returns (S c) { + c = s; + } + function g() internal view returns (S) { + return s; + } + function h() internal pure returns (S) { + } + function i(bool flag) internal view returns (S c) { + if (flag) c = s; + } + function j(bool flag) internal view returns (S) { + if (flag) return s; + } +} +// ----