Merge pull request #8871 from ethereum/nonValueImmutables

Assertion about getters for non-value type immutables.
This commit is contained in:
chriseth 2020-05-07 18:46:24 +02:00 committed by GitHub
commit 6ad65d7db4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -203,7 +203,7 @@ string IRGenerator::generateGetter(VariableDeclaration const& _varDecl)
if (auto const* mappingType = dynamic_cast<MappingType const*>(type))
return m_context.functionCollector().createFunction(functionName, [&]() {
solAssert(!_varDecl.isConstant(), "");
solAssert(!_varDecl.isConstant() && !_varDecl.immutable(), "");
pair<u256, unsigned> slot_offset = m_context.storageLocationOfVariable(_varDecl);
solAssert(slot_offset.second == 0, "");
FunctionType funType(_varDecl);