Fix wrong failure

This commit is contained in:
Anton Bukov 2023-05-06 23:10:32 +03:00
parent 09e85879d7
commit 66c54ef128

View File

@ -4189,15 +4189,7 @@ MemberList::MemberMap MagicType::nativeMembers(ASTNode const*) const
}); });
case Kind::MetaType: case Kind::MetaType:
{ {
solAssert( solAssert(m_typeArgument != nullptr, "");
m_typeArgument && (
m_typeArgument->category() == Type::Category::Contract ||
m_typeArgument->category() == Type::Category::Integer ||
m_typeArgument->category() == Type::Category::Enum
),
"Only enums, contracts or integer types supported for now"
);
if (m_typeArgument->category() == Type::Category::Contract) if (m_typeArgument->category() == Type::Category::Contract)
{ {
ContractDefinition const& contract = dynamic_cast<ContractType const&>(*m_typeArgument).contractDefinition(); ContractDefinition const& contract = dynamic_cast<ContractType const&>(*m_typeArgument).contractDefinition();
@ -4235,6 +4227,10 @@ MemberList::MemberMap MagicType::nativeMembers(ASTNode const*) const
{"max", enumTypePointer}, {"max", enumTypePointer},
}); });
} }
else
{
solAssert(false, "Only enums, contracts, structs or integer types supported for now");
}
} }
} }
solAssert(false, "Unknown kind of magic."); solAssert(false, "Unknown kind of magic.");