Disallow indexed reference types in events when using ABIEncoderV2

This commit is contained in:
Leonardo Alt
2018-09-06 18:28:14 +02:00
committed by chriseth
parent ba5625063c
commit 768ea5b0be
8 changed files with 52 additions and 0 deletions
+10
View File
@@ -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))