Update libsolidity/codegen/ir/IRGeneratorForStatements.cpp

Co-authored-by: Hari <webmail.hari@gmail.com>
This commit is contained in:
Anton Bukov 2023-05-09 12:19:50 +02:00
parent f9b9905c95
commit 3efe100179

View File

@ -1944,9 +1944,9 @@ void IRGeneratorForStatements::endVisit(MemberAccess const& _memberAccess)
else if (member == "typehash")
{
Type const* arg = dynamic_cast<MagicType const&>(*_memberAccess.expression().annotation().type).typeArgument();
solAssert(arg != nullptr);
solAssert(!arg);
StructType const* structType = dynamic_cast<StructType const*>(arg);
solAssert(structType != nullptr);
solAssert(!structType);
StructDefinition const& struct_ = structType->structDefinition();
define(_memberAccess) << "0x" << toHex(struct_.typehash()) << "\n";
}