mirror of
https://github.com/irmen/prog8.git
synced 2025-08-14 22:27:48 +00:00
clearer error msg
This commit is contained in:
@@ -1041,7 +1041,7 @@ internal class AstChecker(private val program: Program,
|
|||||||
} else if((leftDt==DataType.UWORD && rightDt==DataType.STR) || (leftDt==DataType.STR && rightDt==DataType.UWORD)) {
|
} else if((leftDt==DataType.UWORD && rightDt==DataType.STR) || (leftDt==DataType.STR && rightDt==DataType.UWORD)) {
|
||||||
// exception allowed: comparing uword (pointer) with string
|
// exception allowed: comparing uword (pointer) with string
|
||||||
} else {
|
} else {
|
||||||
errors.err("left and right operands aren't the same type", expr.position)
|
errors.err("left and right operands aren't the same type: $leftDt vs $rightDt", expr.position)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -235,7 +235,7 @@ class TypecastsAdder(val program: Program, val options: CompilationOptions, val
|
|||||||
if(toFix!=null) {
|
if(toFix!=null) {
|
||||||
if(commonDt==DataType.BOOL) {
|
if(commonDt==DataType.BOOL) {
|
||||||
// don't automatically cast to bool
|
// don't automatically cast to bool
|
||||||
errors.err("left and right operands aren't the same type", expr.position)
|
errors.err("left and right operands aren't the same type: $leftDt vs $rightDt", expr.position)
|
||||||
} else {
|
} else {
|
||||||
val modifications = mutableListOf<IAstModification>()
|
val modifications = mutableListOf<IAstModification>()
|
||||||
when {
|
when {
|
||||||
|
Reference in New Issue
Block a user