mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Extend type(X) validation to support structs
This commit is contained in:
parent
66c54ef128
commit
e8a311268d
@ -316,6 +316,7 @@ TypePointers TypeChecker::typeCheckMetaTypeFunctionAndRetrieveReturnType(Functio
|
||||
wrongType = contractType->isSuper();
|
||||
else if (
|
||||
typeCategory != Type::Category::Integer &&
|
||||
typeCategory != Type::Category::Struct &&
|
||||
typeCategory != Type::Category::Enum
|
||||
)
|
||||
wrongType = true;
|
||||
|
@ -563,10 +563,11 @@ MagicType const* TypeProvider::meta(Type const* _type)
|
||||
solAssert(
|
||||
_type && (
|
||||
_type->category() == Type::Category::Contract ||
|
||||
_type->category() == Type::Category::Struct ||
|
||||
_type->category() == Type::Category::Integer ||
|
||||
_type->category() == Type::Category::Enum
|
||||
),
|
||||
"Only enum, contracts or integer types supported for now."
|
||||
"Only enum, contract, struct or integer types supported for now."
|
||||
);
|
||||
return createAndGet<MagicType>(_type);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user