mirror of
https://github.com/irmen/prog8.git
synced 2024-12-28 12:32:34 +00:00
better error msg
This commit is contained in:
parent
a910c0fddb
commit
c8855b2b10
@ -790,7 +790,7 @@ internal class AstChecker(private val program: Program,
|
||||
|
||||
if(array.parent is VarDecl) {
|
||||
if (!array.value.all { it is NumericLiteralValue || it is AddressOf || isPassByReferenceElement(it) })
|
||||
errors.err("array literal for variable initialization contains invalid types", array.position)
|
||||
errors.err("array literal for variable initialization contains non-constant elements", array.position)
|
||||
} else if(array.parent is ForLoop) {
|
||||
if (!array.value.all { it.constValue(program) != null })
|
||||
errors.err("array literal for iteration must contain constants. Try using a separate array variable instead?", array.position)
|
||||
|
Loading…
Reference in New Issue
Block a user