solidity/test/libsolidity/syntaxTests/types/mapping/assignment_struct.sol

18 lines
661 B
Solidity
Raw Normal View History

contract test {
struct str {
mapping(uint=>uint) map;
}
str data;
function fun() public {
mapping(uint=>uint) storage a = data.map;
data.map = a;
(data.map) = a;
(data.map, data.map) = (a, a);
}
}
// ----
2020-06-07 16:00:52 +00:00
// TypeError 9214: (172-180): Types in storage containing (nested) mappings cannot be assigned to.
// TypeError 9214: (195-203): Types in storage containing (nested) mappings cannot be assigned to.
// TypeError 9214: (219-227): Types in storage containing (nested) mappings cannot be assigned to.
// TypeError 9214: (229-237): Types in storage containing (nested) mappings cannot be assigned to.