From 267ea13e8cfd51c672488416846790cbc66bf88e Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Wed, 6 Mar 2024 20:10:10 +0100 Subject: [PATCH] clearer error msg --- compiler/src/prog8/compiler/astprocessing/AstChecker.kt | 2 +- compiler/src/prog8/compiler/astprocessing/TypecastsAdder.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/src/prog8/compiler/astprocessing/AstChecker.kt b/compiler/src/prog8/compiler/astprocessing/AstChecker.kt index 082e5ff37..8a04ec30a 100644 --- a/compiler/src/prog8/compiler/astprocessing/AstChecker.kt +++ b/compiler/src/prog8/compiler/astprocessing/AstChecker.kt @@ -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)) { // exception allowed: comparing uword (pointer) with string } 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) } } diff --git a/compiler/src/prog8/compiler/astprocessing/TypecastsAdder.kt b/compiler/src/prog8/compiler/astprocessing/TypecastsAdder.kt index e92887577..97a5d1599 100644 --- a/compiler/src/prog8/compiler/astprocessing/TypecastsAdder.kt +++ b/compiler/src/prog8/compiler/astprocessing/TypecastsAdder.kt @@ -235,7 +235,7 @@ class TypecastsAdder(val program: Program, val options: CompilationOptions, val if(toFix!=null) { if(commonDt==DataType.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 { val modifications = mutableListOf() when {