mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Improve typehash() computation for nested structs
This commit is contained in:
@@ -1944,8 +1944,10 @@ void IRGeneratorForStatements::endVisit(MemberAccess const& _memberAccess)
|
||||
else if (member == "typehash")
|
||||
{
|
||||
Type const* arg = dynamic_cast<MagicType const&>(*_memberAccess.expression().annotation().type).typeArgument();
|
||||
auto const& structType = dynamic_cast<StructType const&>(*arg);
|
||||
StructDefinition const& struct_ = structType.structDefinition();
|
||||
solAssert(arg != nullptr);
|
||||
StructType const* structType = dynamic_cast<StructType const*>(arg);
|
||||
solAssert(structType != nullptr);
|
||||
StructDefinition const& struct_ = structType->structDefinition();
|
||||
define(_memberAccess) << formatNumber(struct_.typehash()) << "\n";
|
||||
}
|
||||
else if (member == "min" || member == "max")
|
||||
|
||||
Reference in New Issue
Block a user