diff options
author | chriseth <chris@ethereum.org> | 2018-11-30 02:44:33 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2018-11-30 02:45:06 +0800 |
commit | c445e7dfa4505ba5d914f2d4b29b18107b7e6e97 (patch) | |
tree | cb31e5cbef59fd230403e7a53ed7c5740a610efe /libsolidity/analysis | |
parent | 124a8def845186ba55ee8566b05cc617554dbcbc (diff) | |
download | dexon-solidity-c445e7dfa4505ba5d914f2d4b29b18107b7e6e97.tar.gz dexon-solidity-c445e7dfa4505ba5d914f2d4b29b18107b7e6e97.tar.zst dexon-solidity-c445e7dfa4505ba5d914f2d4b29b18107b7e6e97.zip |
Disallow inline arrays of mapping type.
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 16b6a55e..a80ca7d6 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -1608,6 +1608,9 @@ bool TypeChecker::visit(TupleExpression const& _tuple) { if (!inlineArrayType) m_errorReporter.fatalTypeError(_tuple.location(), "Unable to deduce common type for array elements."); + else if (!inlineArrayType->canLiveOutsideStorage()) + m_errorReporter.fatalTypeError(_tuple.location(), "Type " + inlineArrayType->toString() + " is only valid in storage."); + _tuple.annotation().type = make_shared<ArrayType>(DataLocation::Memory, inlineArrayType, types.size()); } else |