mirror of
https://github.com/irmen/prog8.git
synced 2024-12-23 09:32:43 +00:00
fixed weird error messages when attempting to create variable with type long
This commit is contained in:
parent
88574c87c4
commit
a58cb43c4a
@ -722,7 +722,7 @@ internal class AstChecker(private val program: Program,
|
||||
throw InternalCompilerException("vardecls with multiple names should have been converted into individual vardecls")
|
||||
|
||||
if(decl.datatype==DataType.LONG && decl.type!=VarDeclType.CONST)
|
||||
errors.err("integer overflow", decl.position)
|
||||
errors.err("cannot use long type for variables; only for constants", decl.position)
|
||||
if(decl.type==VarDeclType.MEMORY) {
|
||||
if (decl.datatype == DataType.BOOL || decl.datatype == DataType.ARRAY_BOOL)
|
||||
errors.err("variables mapped in memory should be numeric", decl.position)
|
||||
@ -1956,6 +1956,7 @@ internal class AstChecker(private val program: Program,
|
||||
DataType.UBYTE -> sourceDatatype == DataType.UBYTE
|
||||
DataType.WORD -> sourceDatatype in setOf(DataType.BYTE, DataType.UBYTE, DataType.WORD)
|
||||
DataType.UWORD -> sourceDatatype == DataType.UBYTE || sourceDatatype == DataType.UWORD
|
||||
DataType.LONG -> sourceDatatype in IntegerDatatypes
|
||||
DataType.FLOAT -> sourceDatatype in NumericDatatypes
|
||||
DataType.STR -> sourceDatatype == DataType.STR
|
||||
else -> false
|
||||
|
@ -1,8 +1,6 @@
|
||||
TODO
|
||||
====
|
||||
|
||||
fix weird error messages for long vars long @shared foo2 = 123456
|
||||
|
||||
what to do with bnk(): it's an awkward name but bank() is too general a name and will forbid you to use 'bank' as a variable...
|
||||
add a function like addr() or lsw() to complement bnk() in getting easy access to the lower 16 bits of a long integer?
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
|
||||
main {
|
||||
sub start() {
|
||||
long @shared foo2 = 123456
|
||||
long @shared foo2 = 22
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user