diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp index 764d98816..b132e4ff8 100644 --- a/libsolidity/ast/Types.cpp +++ b/libsolidity/ast/Types.cpp @@ -4189,15 +4189,7 @@ MemberList::MemberMap MagicType::nativeMembers(ASTNode const*) const }); case Kind::MetaType: { - solAssert( - 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" - ); - + solAssert(m_typeArgument != nullptr, ""); if (m_typeArgument->category() == Type::Category::Contract) { ContractDefinition const& contract = dynamic_cast(*m_typeArgument).contractDefinition(); @@ -4235,6 +4227,10 @@ MemberList::MemberMap MagicType::nativeMembers(ASTNode const*) const {"max", enumTypePointer}, }); } + else + { + solAssert(false, "Only enums, contracts, structs or integer types supported for now"); + } } } solAssert(false, "Unknown kind of magic.");