Allow dynamic types in public mappings

This commit is contained in:
Mathias Baumann
2019-02-26 15:48:54 +01:00
parent da7139afc5
commit e4a52aa2f6
5 changed files with 185 additions and 19 deletions
-8
View File
@@ -511,14 +511,6 @@ bool TypeChecker::visit(VariableDeclaration const& _variable)
)
m_errorReporter.typeError(_variable.location(), "Array is too large to be encoded.");
break;
case Type::Category::Mapping:
if (auto mappingType = dynamic_cast<MappingType const*>(varType.get()))
if (
mappingType->keyType()->isDynamicallySized() &&
_variable.visibility() == Declaration::Visibility::Public
)
m_errorReporter.typeError(_variable.location(), "Dynamically-sized keys for public mappings are not supported.");
break;
default:
break;
}