get rid of invalid ARRAY_STRUCT data type (arrays of struct instance are not yet supported)

This commit is contained in:
Irmen de Jong
2025-05-14 17:37:32 +02:00
parent 38448e471c
commit 913ab03963
11 changed files with 49 additions and 68 deletions

View File

@@ -876,7 +876,7 @@ private fun VardeclContext.toAst(type: VarDeclType, value: Expression?): VarDecl
if(baseDt.isPointer)
DataType.arrayOfPointersFromAntlrTo(baseDt.sub, baseDt.subTypeFromAntlr)
else if(baseDt.isStructInstance)
DataType.arrayOfStructsFromAntlr(baseDt.subTypeFromAntlr!!)
throw SyntaxError("array of structures not allowed (use array of pointers)", toPosition())
else
DataType.arrayFor(baseDt.base, split!=SplitWish.NOSPLIT)
}