mirror of
https://github.com/irmen/prog8.git
synced 2025-01-14 01:29:55 +00:00
correction, we don't allow address-of as a value for memory mapped vars, improved the error message instead
This commit is contained in:
parent
bc89306dc1
commit
f2b069c562
@ -589,10 +589,8 @@ internal class AstChecker(private val program: Program,
|
||||
if (value.type !in IntegerDatatypes || value.number.toInt() < 0 || value.number.toInt() > 65535) {
|
||||
err("memory address must be valid integer 0..\$ffff", decl.value?.position)
|
||||
}
|
||||
} else if(decl.value is AddressOf) {
|
||||
// we allow this too: the address of another variable
|
||||
} else {
|
||||
err("value of memory var decl is invalid type.", decl.value?.position)
|
||||
err("value of memory mapped variable can only be a number, perhaps you meant to use an address pointer type instead?", decl.value?.position)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user