solidity/test/libsolidity/semanticTests/structs/delete_struct.sol
Marenz 5663fbb903 Merge branch 'develop' into breaking
Manual Resolved Conflicts:
	Changelog.md
	 * Updated changelog
	test/externalTests/ens.sh
	 * Merged fixes for upstream from both develop and breaking
	test/libsolidity/semanticTests/inlineAssembly/external_identifier_access_shadowing.sol
	 * Removed in #11735 (breaking)
	test/libsolidity/semanticTests/inlineAssembly/function_name_clash.sol
	 * Removed in #12209 (breaking)
	test/libsolidity/semanticTests/storage/mappings_array2d_pop_delete.sol
	 * Removed in #11843 (breaking)
	test/libsolidity/semanticTests/storage/mappings_array_pop_delete.sol
	 * Removed in #11843 (breaking)
	test/libsolidity/syntaxTests/inlineAssembly/basefee_berlin_function.sol
	 * Used version of file from #11842 (breaking)
2022-08-30 18:07:20 +02:00

33 lines
755 B
Solidity

contract test {
struct topStruct {
nestedStruct nstr;
uint topValue;
}
uint toDelete;
topStruct str;
struct nestedStruct {
uint nestedValue;
}
constructor() {
toDelete = 5;
str.topValue = 1;
str.nstr.nestedValue = 2;
delete str;
delete toDelete;
}
function getToDelete() public returns (uint res){
res = toDelete;
}
function getTopValue() public returns(uint topValue){
topValue = str.topValue;
}
function getNestedValue() public returns(uint nestedValue){
nestedValue = str.nstr.nestedValue;
}
}
// ----
// getToDelete() -> 0
// getTopValue() -> 0
// getNestedValue() -> 0 #mapping values should be the same#