Update libsolidity/codegen/ExpressionCompiler.cpp

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

View File

@ -1934,6 +1934,7 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess)
else if (member == "typehash")
{
Type const* arg = dynamic_cast<MagicType const&>(*_memberAccess.expression().annotation().type).typeArgument();
solAssert(dynamic_cast<StructType const*>(arg), "typehash called on a non-struct type")
StructDefinition const& struct_ = dynamic_cast<StructType const&>(*arg).structDefinition();
m_context << struct_.typehash();
}