Merge pull request #8983 from ethereum/develop

Merge develop into breaking.
This commit is contained in:
chriseth
2020-05-19 18:05:28 +02:00
committed by GitHub
130 changed files with 2140 additions and 491 deletions
+9 -1
View File
@@ -455,7 +455,15 @@ bool TypeChecker::visit(VariableDeclaration const& _variable)
if (contractType->contractDefinition().isLibrary())
m_errorReporter.typeError(1273_error, _variable.location(), "The type of a variable cannot be a library.");
if (_variable.value())
expectType(*_variable.value(), *varType);
{
if (_variable.isStateVariable() && dynamic_cast<MappingType const*>(varType))
{
m_errorReporter.typeError(6280_error, _variable.location(), "Mappings cannot be assigned to.");
_variable.value()->accept(*this);
}
else
expectType(*_variable.value(), *varType);
}
if (_variable.isConstant())
{
if (!_variable.type()->isValueType())