solidity/test/libsolidity/semanticTests/structs/struct_delete_struct_in_mapping.sol
2020-03-19 14:42:25 +01:00

19 lines
339 B
Solidity

contract test {
struct testStruct {
uint256 m_value;
}
mapping(uint256 => testStruct) campaigns;
constructor() public {
campaigns[0].m_value = 2;
}
function deleteIt() public returns (uint256) {
delete campaigns[0];
return campaigns[0].m_value;
}
}
// ----
// deleteIt() -> 0