2020-03-09 21:14:07 +00:00
|
|
|
contract test {
|
|
|
|
struct testStruct {
|
|
|
|
uint256 m_value;
|
|
|
|
}
|
|
|
|
testStruct data1;
|
|
|
|
|
2020-06-23 12:14:24 +00:00
|
|
|
constructor() {
|
2020-03-09 21:14:07 +00:00
|
|
|
data1.m_value = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
function deleteMember() public returns (uint256 ret_value) {
|
|
|
|
testStruct storage x = data1; //should not copy the data. data1.m_value == 2 but x.m_value = 0
|
|
|
|
x.m_value = 4;
|
|
|
|
delete x.m_value;
|
|
|
|
ret_value = data1.m_value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-06 12:08:00 +00:00
|
|
|
// ====
|
2020-11-21 13:54:16 +00:00
|
|
|
// compileToEwasm: also
|
2021-03-12 23:02:36 +00:00
|
|
|
// compileViaYul: also
|
2020-03-09 21:14:07 +00:00
|
|
|
// ----
|
|
|
|
// deleteMember() -> 0
|