From f2b069c562ee60653d12168ccad0416e71e424a7 Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Sat, 19 Sep 2020 15:54:42 +0200 Subject: [PATCH] correction, we don't allow address-of as a value for memory mapped vars, improved the error message instead --- compiler/src/prog8/ast/processing/AstChecker.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/compiler/src/prog8/ast/processing/AstChecker.kt b/compiler/src/prog8/ast/processing/AstChecker.kt index 6eca98e2a..55ced418f 100644 --- a/compiler/src/prog8/ast/processing/AstChecker.kt +++ b/compiler/src/prog8/ast/processing/AstChecker.kt @@ -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) } } }