mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Disallow indexed reference types in events when using ABIEncoderV2
This commit is contained in:
@@ -869,7 +869,17 @@ bool TypeChecker::visit(EventDefinition const& _eventDef)
|
||||
for (ASTPointer<VariableDeclaration> const& var: _eventDef.parameters())
|
||||
{
|
||||
if (var->isIndexed())
|
||||
{
|
||||
numIndexed++;
|
||||
if (
|
||||
_eventDef.sourceUnit().annotation().experimentalFeatures.count(ExperimentalFeature::ABIEncoderV2)
|
||||
&& dynamic_cast<ReferenceType const*>(type(*var).get())
|
||||
)
|
||||
m_errorReporter.typeError(
|
||||
var->location(),
|
||||
"Reference types cannot be indexed."
|
||||
);
|
||||
}
|
||||
if (!type(*var)->canLiveOutsideStorage())
|
||||
m_errorReporter.typeError(var->location(), "Type is required to live outside storage.");
|
||||
if (!type(*var)->interfaceType(false))
|
||||
|
||||
Reference in New Issue
Block a user