mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Disallow calldata structs.
This commit is contained in:
committed by
chriseth
parent
d3270bc311
commit
610ef9f199
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user