瀏覽代碼

Improved error message for undefined operators

HurryStarfish 6 年之前
父節點
當前提交
a17945d278
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      expr.bmx

+ 2 - 2
expr.bmx

@@ -1661,7 +1661,7 @@ Type TUnaryExpr Extends TExpr
 				If error.StartsWith("Compile Error") Then
 					Throw error
 				Else
-					Err "Operator " + op + " cannot be used with Objects."
+					Err "Operator " + op + " is not defined for type '" + expr.exprType.ToString() + "'"
 				End If
 			End Try
 		End If
@@ -1775,7 +1775,7 @@ Type TBinaryMathExpr Extends TBinaryExpr
 				If error.StartsWith("Compile Error") Then
 					Throw error
 				Else
-					Err "Operator " + op + " cannot be used with Objects."
+					Err "Operator " + op + " is not defined between types '" + lhs.exprType.ToString() + "' and '" + rhs.exprType.ToString() + "'"
 				End If
 			End Try
 		End If