mirror of
https://github.com/irmen/prog8.git
synced 2025-02-19 11:31:07 +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")
|
else -> throw AssemblyError("weird type")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DataType.STR -> {
|
DataType.STR -> throw AssemblyError("cannot typecast a string value")
|
||||||
if (targetDt != DataType.UWORD && targetDt == DataType.STR)
|
|
||||||
throw AssemblyError("cannot typecast a string into another incompatitble type")
|
|
||||||
TODO("assign typecasted string into target var")
|
|
||||||
}
|
|
||||||
else -> throw AssemblyError("weird type")
|
else -> throw AssemblyError("weird type")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -710,11 +706,7 @@ internal class AssignmentAsmGen(private val program: Program, private val asmgen
|
|||||||
else -> throw AssemblyError("weird type")
|
else -> throw AssemblyError("weird type")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DataType.STR -> {
|
DataType.STR -> throw AssemblyError("cannot typecast a string value")
|
||||||
if (targetDt != DataType.UWORD && targetDt == DataType.STR)
|
|
||||||
throw AssemblyError("cannot typecast a string into another incompatitble type")
|
|
||||||
TODO("assign typecasted string into target var")
|
|
||||||
}
|
|
||||||
else -> throw AssemblyError("weird type")
|
else -> throw AssemblyError("weird type")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,13 +5,14 @@ main {
|
|||||||
|
|
||||||
sub start() {
|
sub start() {
|
||||||
|
|
||||||
ubyte zero
|
str string1 = "irmen"
|
||||||
ubyte one=1
|
str string2 = "hello"
|
||||||
|
|
||||||
ubyte qq=1
|
uword xx = $f000
|
||||||
qq = qq + c64.CHKIN(1) * qq
|
|
||||||
|
|
||||||
txt.print_ub(qq)
|
; string1 = xx
|
||||||
|
; string1 = string2
|
||||||
|
string1 = string2 as uword
|
||||||
|
|
||||||
; ubyte[] array = [1,2,3,4]
|
; ubyte[] array = [1,2,3,4]
|
||||||
; ubyte ix
|
; ubyte ix
|
||||||
|
Loading…
x
Reference in New Issue
Block a user