mirror of
https://github.com/irmen/prog8.git
synced 2025-02-27 18:29:00 +00:00
array literal const check added
This commit is contained in:
parent
f1ee3b4e60
commit
9b66a597bb
@ -1 +1 @@
|
||||
4.2
|
||||
4.3-SNAPSHOT
|
||||
|
@ -742,6 +742,11 @@ internal class AstChecker(private val program: Program,
|
||||
checkValueTypeAndRangeArray(array.type.typeOrElse(DataType.STRUCT), null, arrayspec, array)
|
||||
}
|
||||
|
||||
if(!array.value.all { it.constValue(program)!=null }) {
|
||||
// TODO for now, array literals have to consist of all compile time constant values...
|
||||
errors.err("array literal doesn't consist of only compile time constant values", array.position)
|
||||
}
|
||||
|
||||
super.visit(array)
|
||||
}
|
||||
|
||||
@ -1098,7 +1103,7 @@ internal class AstChecker(private val program: Program,
|
||||
}
|
||||
|
||||
if(value.type.isUnknown)
|
||||
return err("attempt to check values of array with as yet unknown datatype")
|
||||
return false
|
||||
|
||||
when (targetDt) {
|
||||
DataType.STR -> return err("string value expected")
|
||||
|
@ -5,6 +5,7 @@ TODO
|
||||
- get rid of all other TODO's in the code ;-)
|
||||
- line-circle-gfx examples are now a few hundred bytes larger than before. Why is that, can it be fixed?
|
||||
- compiler errors and warnings in standard format so the IDE shows them as clickable links; ./test.asm:2578:3: blablabla
|
||||
- make it possible for array literals to not only contain compile time constants
|
||||
- further optimize assignment codegeneration
|
||||
- auto select correct library to import based on target, instead of having c64- and cx16- prefix variants
|
||||
- implement @stack for asmsub parameters
|
||||
|
Loading…
x
Reference in New Issue
Block a user