New interface to Typer: the function TypeName() returns a more readable type name
This commit is contained in:
@@ -161,11 +161,18 @@ func (self *term) toInt(computedValue any, valueDescription string) (i int, err
|
||||
}
|
||||
|
||||
func (self *term) errIncompatibleTypes(leftValue, rightValue any) error {
|
||||
leftType := getTypeName(leftValue)
|
||||
rightType := getTypeName(rightValue)
|
||||
return self.tk.Errorf(
|
||||
"left operand '%v' [%T] and right operand '%v' [%T] are not compatible with operator %q",
|
||||
leftValue, leftValue,
|
||||
rightValue, rightValue,
|
||||
"left operand '%v' [%s] and right operand '%v' [%s] are not compatible with operator %q",
|
||||
leftValue, leftType,
|
||||
rightValue, rightType,
|
||||
self.source())
|
||||
// return self.tk.Errorf(
|
||||
// "left operand '%v' [%T] and right operand '%v' [%T] are not compatible with operator %q",
|
||||
// leftValue, leftValue,
|
||||
// rightValue, rightValue,
|
||||
// self.source())
|
||||
}
|
||||
|
||||
func (self *term) errIncompatibleType(value any) error {
|
||||
|
||||
Reference in New Issue
Block a user