diff options
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 15 | ||||
-rw-r--r-- | test/libsolidity/syntaxTests/memberLookup/memory_structs_with_mappings.sol | 10 |
2 files changed, 10 insertions, 15 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index 7c0e8643..97cf0410 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -2993,21 +2993,6 @@ BOOST_AUTO_TEST_CASE(literal_strings) CHECK_SUCCESS(text); } -BOOST_AUTO_TEST_CASE(memory_structs_with_mappings) -{ - char const* text = R"( - contract Test { - struct S { uint8 a; mapping(uint => uint) b; uint8 c; } - S s; - function f() public { - S memory x; - x.b[1]; - } - } - )"; - CHECK_ERROR(text, TypeError, "Member \"b\" is not available in struct Test.S memory outside of storage."); -} - BOOST_AUTO_TEST_CASE(string_bytes_conversion) { char const* text = R"( diff --git a/test/libsolidity/syntaxTests/memberLookup/memory_structs_with_mappings.sol b/test/libsolidity/syntaxTests/memberLookup/memory_structs_with_mappings.sol new file mode 100644 index 00000000..bdafc754 --- /dev/null +++ b/test/libsolidity/syntaxTests/memberLookup/memory_structs_with_mappings.sol @@ -0,0 +1,10 @@ +contract Test { + struct S { uint8 a; mapping(uint => uint) b; uint8 c; } + S s; + function f() public { + S memory x; + x.b[1]; + } +} +// ---- +// TypeError: (118-121): Member "b" is not available in struct Test.S memory outside of storage. |