diff --git a/compiler/src/prog8/compiler/target/cpu6502/codegen/assignment/AssignmentAsmGen.kt b/compiler/src/prog8/compiler/target/cpu6502/codegen/assignment/AssignmentAsmGen.kt index efdeeb496..d487190ae 100644 --- a/compiler/src/prog8/compiler/target/cpu6502/codegen/assignment/AssignmentAsmGen.kt +++ b/compiler/src/prog8/compiler/target/cpu6502/codegen/assignment/AssignmentAsmGen.kt @@ -571,11 +571,7 @@ internal class AssignmentAsmGen(private val program: Program, private val asmgen else -> throw AssemblyError("weird type") } } - DataType.STR -> { - if (targetDt != DataType.UWORD && targetDt == DataType.STR) - throw AssemblyError("cannot typecast a string into another incompatitble type") - TODO("assign typecasted string into target var") - } + DataType.STR -> throw AssemblyError("cannot typecast a string value") else -> throw AssemblyError("weird type") } } @@ -710,11 +706,7 @@ internal class AssignmentAsmGen(private val program: Program, private val asmgen else -> throw AssemblyError("weird type") } } - DataType.STR -> { - if (targetDt != DataType.UWORD && targetDt == DataType.STR) - throw AssemblyError("cannot typecast a string into another incompatitble type") - TODO("assign typecasted string into target var") - } + DataType.STR -> throw AssemblyError("cannot typecast a string value") else -> throw AssemblyError("weird type") } } diff --git a/examples/test.p8 b/examples/test.p8 index bb107b980..3598cff5b 100644 --- a/examples/test.p8 +++ b/examples/test.p8 @@ -5,13 +5,14 @@ main { sub start() { - ubyte zero - ubyte one=1 + str string1 = "irmen" + str string2 = "hello" - ubyte qq=1 - qq = qq + c64.CHKIN(1) * qq + uword xx = $f000 - txt.print_ub(qq) +; string1 = xx +; string1 = string2 + string1 = string2 as uword ; ubyte[] array = [1,2,3,4] ; ubyte ix