Disallow calldata structs.

This commit is contained in:
Daniel Kirchner
2019-01-21 10:30:57 +01:00
committed by chriseth
parent d3270bc311
commit 610ef9f199
6 changed files with 44 additions and 5 deletions
+10
View File
@@ -359,6 +359,16 @@ bool TypeChecker::visit(FunctionDefinition const& _function)
};
for (ASTPointer<VariableDeclaration> const& var: _function.parameters())
{
TypePointer baseType = type(*var);
while (auto const* arrayType = dynamic_cast<ArrayType const*>(baseType.get()))
baseType = arrayType->baseType();
if (
!m_scope->isInterface() &&
baseType->category() == Type::Category::Struct &&
baseType->dataStoredIn(DataLocation::CallData)
)
m_errorReporter.typeError(var->location(), "Calldata structs are not yet supported.");
checkArgumentAndReturnParameter(*var);
var->accept(*this);
}