clearer error msg

This commit is contained in:
Irmen de Jong 2024-03-06 20:10:10 +01:00
parent 9f1bd2d7d6
commit 267ea13e8c
2 changed files with 2 additions and 2 deletions

View File

@ -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)
} }
} }

View File

@ -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 {