diff options
author | chriseth <chris@ethereum.org> | 2018-09-10 18:59:35 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-10 18:59:35 +0800 |
commit | a1848ac9470a97bf2f158b91a558391ee9f70c11 (patch) | |
tree | eedcfade888b672adbfe199252429db4f9971cdd /libsolidity | |
parent | 61ee88ff0e624e87872ad9ba47654d8bfe80f047 (diff) | |
parent | 99022216cd19ecb777bf20c4bfff6fd12395c12e (diff) | |
download | dexon-solidity-a1848ac9470a97bf2f158b91a558391ee9f70c11.tar dexon-solidity-a1848ac9470a97bf2f158b91a558391ee9f70c11.tar.gz dexon-solidity-a1848ac9470a97bf2f158b91a558391ee9f70c11.tar.bz2 dexon-solidity-a1848ac9470a97bf2f158b91a558391ee9f70c11.tar.lz dexon-solidity-a1848ac9470a97bf2f158b91a558391ee9f70c11.tar.xz dexon-solidity-a1848ac9470a97bf2f158b91a558391ee9f70c11.tar.zst dexon-solidity-a1848ac9470a97bf2f158b91a558391ee9f70c11.zip |
Merge pull request #4920 from ethereum/disallow_indexed_ref_v2_for_0_425
Disallow indexed reference types in events when using ABIEncoderV2 (backported)
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index f6980872..2062458e 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -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(), + "Indexed reference types cannot yet be used with ABIEncoderV2." + ); + } if (!type(*var)->canLiveOutsideStorage()) m_errorReporter.typeError(var->location(), "Type is required to live outside storage."); if (!type(*var)->interfaceType(false)) |