Merge remote-tracking branch 'origin/develop' into breaking

This commit is contained in:
chriseth
2021-12-21 18:14:45 +01:00
16 changed files with 197 additions and 104 deletions
+8 -1
View File
@@ -592,7 +592,14 @@ bool TypeChecker::visit(VariableDeclaration const& _variable)
);
}
if (!getter.interfaceFunctionType())
m_errorReporter.typeError(6744_error, _variable.location(), "Internal or recursive type is not allowed for public state variables.");
{
solAssert(getter.returnParameterNames().size() == getter.returnParameterTypes().size());
solAssert(getter.parameterNames().size() == getter.parameterTypes().size());
if (getter.returnParameterTypes().empty() && getter.parameterTypes().empty())
m_errorReporter.typeError(5359_error, _variable.location(), "The struct has all its members omitted, therefore the getter cannot return any values.");
else
m_errorReporter.typeError(6744_error, _variable.location(), "Internal or recursive type is not allowed for public state variables.");
}
}
bool isStructMemberDeclaration = dynamic_cast<StructDefinition const*>(_variable.scope()) != nullptr;