mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix errors when struct array type is used on its own.
This commit is contained in:
@@ -950,6 +950,12 @@ bool ExpressionCompiler::visit(IndexAccess const& _indexAccess)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (baseType.category() == Type::Category::TypeType)
|
||||
{
|
||||
solAssert(baseType.sizeOnStack() == 0, "");
|
||||
solAssert(_indexAccess.annotation().type->sizeOnStack() == 0, "");
|
||||
// no-op - this seems to be a lone array type (`structType[];`)
|
||||
}
|
||||
else
|
||||
solAssert(false, "Index access only allowed for mappings or arrays.");
|
||||
|
||||
@@ -1003,6 +1009,10 @@ void ExpressionCompiler::endVisit(Identifier const& _identifier)
|
||||
{
|
||||
// no-op
|
||||
}
|
||||
else if (dynamic_cast<StructDefinition const*>(declaration))
|
||||
{
|
||||
// no-op
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Identifier type not expected in expression context."));
|
||||
|
||||
Reference in New Issue
Block a user