瀏覽代碼

Fixed const comparison string cast. Fixes #249

woollybah 8 年之前
父節點
當前提交
cc8286301e
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      expr.bmx

+ 4 - 1
expr.bmx

@@ -1486,7 +1486,6 @@ Type TCastExpr Extends TExpr
 
 	Method Eval$()
 		Local val$=expr.Eval()
-		If Not val Return val
 		If TBoolType( exprType )
 			If TIntegralType(expr.exprType)
 				If Long( val ) Return "1"
@@ -1527,6 +1526,10 @@ Type TCastExpr Extends TExpr
 		Else If TFloat64Type( exprType )
 			Return Float( val )
 		Else If TStringType( exprType )
+			If TBoolType( expr.exprType )
+				If val Return "1"
+				Return "0"
+			EndIf
 			Return String( val )
 		Else If TByteType( exprType )
 			Return Byte( val )