Merge pull request #10805 from ethereum/structMappingTestCase

Adding test for conversion of struct from storage to mapping.
This commit is contained in:
chriseth 2021-01-18 15:48:02 +01:00 committed by GitHub
commit 1ad1591617
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,17 @@
contract C {
struct S {
uint a;
}
S s;
mapping (uint => S) m;
function f() external returns (bool) {
s.a = 12;
m[1] = s;
return m[1].a == 12;
}
}
// ====
// compileViaYul: also
// ----
// f() -> true