mirror of
https://github.com/irmen/prog8.git
synced 2025-02-16 22:30:46 +00:00
asmgen: string values cannot be typecasted
This commit is contained in:
parent
112a7b09f2
commit
292640b17a
@ -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")
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user