Explorar el Código

Fixed const comparison string cast. Fixes #249

woollybah hace 8 años
padre
commit
cc8286301e
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  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 )