diff --git a/src/fsharp/TastOps.fs b/src/fsharp/TastOps.fs index 75716383667..53b92da0fb4 100644 --- a/src/fsharp/TastOps.fs +++ b/src/fsharp/TastOps.fs @@ -6187,7 +6187,6 @@ let mkCallToSByteOperator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrin let mkCallToInt16Operator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.int16_operator_info, [[ty]], [e1], m) let mkCallToUInt16Operator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.uint16_operator_info, [[ty]], [e1], m) let mkCallToIntOperator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.int_operator_info, [[ty]], [e1], m) -let mkCallToEnumOperator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.enum_operator_info, [[ty]], [e1], m) let mkCallToInt32Operator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.int32_operator_info, [[ty]], [e1], m) let mkCallToUInt32Operator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.uint32_operator_info, [[ty]], [e1], m) let mkCallToInt64Operator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.int64_operator_info, [[ty]], [e1], m) @@ -6197,6 +6196,9 @@ let mkCallToDoubleOperator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrin let mkCallToIntPtrOperator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.nativeint_operator_info, [[ty]], [e1], m) let mkCallToUIntPtrOperator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.unativeint_operator_info, [[ty]], [e1], m) +let mkCallToCharOperator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.char_operator_info, [[ty]], [e1], m) +let mkCallToEnumOperator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.enum_operator_info, [[ty]], [e1], m) + let mkCallArrayLength (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.array_length_info, [[ty]], [e1], m) let mkCallArrayGet (g:TcGlobals) m ty e1 idx1 = mkApps g (typedExprForIntrinsic g m g.array_get_info, [[ty]], [ e1 ; idx1 ], m) let mkCallArray2DGet (g:TcGlobals) m ty e1 idx1 idx2 = mkApps g (typedExprForIntrinsic g m g.array2D_get_info, [[ty]], [ e1 ; idx1; idx2 ], m) diff --git a/src/fsharp/TastOps.fsi b/src/fsharp/TastOps.fsi index aefe35c8edc..9f23629b25e 100755 --- a/src/fsharp/TastOps.fsi +++ b/src/fsharp/TastOps.fsi @@ -1280,7 +1280,6 @@ val mkCallToSByteOperator : TcGlobals -> range -> TType -> Ex val mkCallToInt16Operator : TcGlobals -> range -> TType -> Expr -> Expr val mkCallToUInt16Operator : TcGlobals -> range -> TType -> Expr -> Expr val mkCallToIntOperator : TcGlobals -> range -> TType -> Expr -> Expr -val mkCallToEnumOperator : TcGlobals -> range -> TType -> Expr -> Expr val mkCallToInt32Operator : TcGlobals -> range -> TType -> Expr -> Expr val mkCallToUInt32Operator : TcGlobals -> range -> TType -> Expr -> Expr val mkCallToInt64Operator : TcGlobals -> range -> TType -> Expr -> Expr @@ -1290,6 +1289,9 @@ val mkCallToDoubleOperator : TcGlobals -> range -> TType -> Ex val mkCallToIntPtrOperator : TcGlobals -> range -> TType -> Expr -> Expr val mkCallToUIntPtrOperator : TcGlobals -> range -> TType -> Expr -> Expr +val mkCallToCharOperator : TcGlobals -> range -> TType -> Expr -> Expr +val mkCallToEnumOperator : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallDeserializeQuotationFSharp20Plus : TcGlobals -> range -> Expr -> Expr -> Expr -> Expr -> Expr val mkCallDeserializeQuotationFSharp40Plus : TcGlobals -> range -> Expr -> Expr -> Expr -> Expr -> Expr -> Expr val mkCallCastQuotation : TcGlobals -> range -> TType -> Expr -> Expr diff --git a/src/fsharp/TcGlobals.fs b/src/fsharp/TcGlobals.fs index 32bb8af8389..72c8fbb0a75 100755 --- a/src/fsharp/TcGlobals.fs +++ b/src/fsharp/TcGlobals.fs @@ -295,7 +295,6 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d let v_int16_ty = mkNonGenericTy v_int16_tcr let v_uint16_ty = mkNonGenericTy v_uint16_tcr let v_int_ty = mkNonGenericTy v_int_tcr - let v_enum_ty = mkNonGenericTy v_int_tcr let v_int32_ty = mkNonGenericTy v_int32_tcr let v_uint32_ty = mkNonGenericTy v_uint32_tcr let v_int64_ty = mkNonGenericTy v_int64_tcr @@ -305,6 +304,7 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d let v_nativeint_ty = mkNonGenericTy v_nativeint_tcr let v_unativeint_ty = mkNonGenericTy v_unativeint_tcr + let v_enum_ty = mkNonGenericTy v_int_tcr let v_bool_ty = mkNonGenericTy v_bool_tcr let v_char_ty = mkNonGenericTy v_char_tcr let v_obj_ty = mkNonGenericTy v_obj_tcr @@ -607,7 +607,6 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d let v_int16_operator_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "int16" , None , Some "ToInt16", [vara], ([[varaTy]], v_int16_ty)) let v_uint16_operator_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "uint16" , None , Some "ToUInt16", [vara], ([[varaTy]], v_uint16_ty)) let v_int_operator_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "int" , None , Some "ToInt", [vara], ([[varaTy]], v_int_ty)) - let v_enum_operator_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "enum" , None , Some "ToEnum", [vara], ([[varaTy]], v_enum_ty)) let v_int32_operator_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "int32" , None , Some "ToInt32", [vara], ([[varaTy]], v_int32_ty)) let v_uint32_operator_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "uint32" , None , Some "ToUInt32", [vara], ([[varaTy]], v_uint32_ty)) let v_int64_operator_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "int64" , None , Some "ToInt64", [vara], ([[varaTy]], v_int64_ty)) @@ -617,6 +616,9 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d let v_nativeint_operator_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "nativeint" , None , Some "ToIntPtr", [vara], ([[varaTy]], v_nativeint_ty)) let v_unativeint_operator_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "unativeint" , None , Some "ToUIntPtr", [vara], ([[varaTy]], v_unativeint_ty)) + let v_char_operator_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "char" , None , Some "ToChar", [vara], ([[varaTy]], v_char_ty)) + let v_enum_operator_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "enum" , None , Some "ToEnum", [vara], ([[varaTy]], v_enum_ty)) + let v_hash_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "hash" , None , Some "Hash" , [vara], ([[varaTy]], v_int_ty)) let v_box_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "box" , None , Some "Box" , [vara], ([[varaTy]], v_obj_ty)) let v_isnull_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "isNull" , None , Some "IsNull" , [vara], ([[varaTy]], v_bool_ty)) @@ -886,6 +888,8 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d member __.expr_tcr = v_expr_tcr member __.raw_expr_tcr = v_raw_expr_tcr member __.nativeint_tcr = v_nativeint_tcr + member __.unativeint_tcr = v_unativeint_tcr + member __.int_tcr = v_int_tcr member __.int32_tcr = v_int32_tcr member __.int16_tcr = v_int16_tcr member __.int64_tcr = v_int64_tcr @@ -1227,7 +1231,6 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d member __.int16_operator_info = v_int16_operator_info member __.uint16_operator_info = v_uint16_operator_info member __.int_operator_info = v_int_operator_info - member __.enum_operator_info = v_enum_operator_info member __.int32_operator_info = v_int32_operator_info member __.uint32_operator_info = v_uint32_operator_info member __.int64_operator_info = v_int64_operator_info @@ -1237,6 +1240,9 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d member __.nativeint_operator_info = v_nativeint_operator_info member __.unativeint_operator_info = v_unativeint_operator_info + member __.char_operator_info = v_char_operator_info + member __.enum_operator_info = v_enum_operator_info + member val compare_operator_vref = ValRefForIntrinsic v_compare_operator_info member val equals_operator_vref = ValRefForIntrinsic v_equals_operator_info member val equals_nullable_operator_vref = ValRefForIntrinsic v_equals_nullable_operator_info diff --git a/src/fsharp/symbols/Exprs.fs b/src/fsharp/symbols/Exprs.fs index ba5c1872438..f75403a4155 100644 --- a/src/fsharp/symbols/Exprs.fs +++ b/src/fsharp/symbols/Exprs.fs @@ -268,6 +268,27 @@ module FSharpExprConvert = | DT_REF -> None | _ -> None + let (|TTypeConvOp|_|) (cenv:Impl.cenv) ty = + let g = cenv.g + match ty with + | TType_app (tcref,_) -> + match tcref with + | x when tyconRefEq g tcref g.sbyte_tcr -> Some mkCallToSByteOperator + | x when tyconRefEq g tcref g.byte_tcr -> Some mkCallToByteOperator + | x when tyconRefEq g tcref g.int16_tcr -> Some mkCallToInt16Operator + | x when tyconRefEq g tcref g.uint16_tcr -> Some mkCallToUInt16Operator + | x when tyconRefEq g tcref g.int_tcr -> Some mkCallToIntOperator + | x when tyconRefEq g tcref g.int32_tcr -> Some mkCallToInt32Operator + | x when tyconRefEq g tcref g.uint32_tcr -> Some mkCallToUInt32Operator + | x when tyconRefEq g tcref g.int64_tcr -> Some mkCallToInt64Operator + | x when tyconRefEq g tcref g.uint64_tcr -> Some mkCallToUInt64Operator + | x when tyconRefEq g tcref g.float32_tcr -> Some mkCallToSingleOperator + | x when tyconRefEq g tcref g.float_tcr -> Some mkCallToDoubleOperator + | x when tyconRefEq g tcref g.nativeint_tcr -> Some mkCallToIntPtrOperator + | x when tyconRefEq g tcref g.unativeint_tcr -> Some mkCallToUIntPtrOperator + | _ -> None + | _ -> None + let ConvType cenv typ = FSharpType(cenv, typ) let ConvTypes cenv typs = List.map (ConvType cenv) typs let ConvILTypeRefApp (cenv:Impl.cenv) m tref tyargs = @@ -601,8 +622,14 @@ module FSharpExprConvert = let argR = ConvExpr cenv env arg E.ILFieldSet(None, typR, fspec.Name, argR) - | TOp.ILAsm([ ], _), _, [arg] -> - ConvExprPrim cenv env arg + | TOp.ILAsm([ ], [tty]), _, [arg] -> + match tty with + | TTypeConvOp cenv convOp -> + let ty = tyOfExpr cenv.g arg + let op = convOp cenv.g m ty arg + ConvExprPrim cenv env op + | _ -> + ConvExprPrim cenv env arg | TOp.ILAsm([ I_box _ ], _), [ty], [arg] -> let op = mkCallBox cenv.g m ty arg @@ -671,9 +698,12 @@ module FSharpExprConvert = let op2 = convertOp2 cenv.g m ty2 op1 ConvExprPrim cenv env op2 - | TOp.ILAsm([ ILConvertOp convertOp ], _), _, [arg] -> + | TOp.ILAsm([ ILConvertOp convertOp ], [TType_app (tcref,_)]), _, [arg] -> let ty = tyOfExpr cenv.g arg - let op = convertOp cenv.g m ty arg + let op = + if tyconRefEq cenv.g tcref cenv.g.char_tcr + then mkCallToCharOperator cenv.g m ty arg + else convertOp cenv.g m ty arg ConvExprPrim cenv env op | TOp.ILAsm([ I_throw ], _), _, [arg1] -> diff --git a/tests/service/ExprTests.fs b/tests/service/ExprTests.fs index b013ee83920..1d3e9675b12 100644 --- a/tests/service/ExprTests.fs +++ b/tests/service/ExprTests.fs @@ -1051,7 +1051,7 @@ let ``Test Operator Declarations for Byte`` () = "let testByteToSingleOperator(e1) = Operators.ToSingle (Operators.ToDouble (e1)) @ (52,43--52,53)"; "let testByteToDoubleOperator(e1) = Operators.ToDouble (Operators.ToDouble (e1)) @ (53,43--53,51)"; "let testByteToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,43--54,53)"; - "let testByteToCharOperator(e1) = Operators.ToUInt16 (e1) @ (55,43--55,50)"; + "let testByteToCharOperator(e1) = Operators.ToChar (e1) @ (55,43--55,50)"; "let testByteToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,43--56,52)"; ] @@ -1151,9 +1151,9 @@ let ``Test Operator Declarations for SByte`` () = "let testSByteToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,45--42,53)"; "let testSByteToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,45--43,53)"; "let testSByteToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,45--44,54)"; - "let testSByteToIntOperator(e1) = e1 @ (45,45--45,51)"; - "let testSByteToInt32Operator(e1) = e1 @ (46,45--46,53)"; - "let testSByteToUInt32Operator(e1) = e1 @ (47,45--47,54)"; + "let testSByteToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,45--45,51)"; + "let testSByteToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,45--46,53)"; + "let testSByteToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,45--47,54)"; "let testSByteToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,45--48,53)"; "let testSByteToUInt64Operator(e1) = Operators.ToInt64 (e1) @ (49,45--49,54)"; "let testSByteToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,45--50,57)"; @@ -1161,7 +1161,7 @@ let ``Test Operator Declarations for SByte`` () = "let testSByteToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,45--52,55)"; "let testSByteToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,45--53,53)"; "let testSByteToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,45--54,55)"; - "let testSByteToCharOperator(e1) = Operators.ToUInt16 (e1) @ (55,45--55,52)"; + "let testSByteToCharOperator(e1) = Operators.ToChar (e1) @ (55,45--55,52)"; "let testSByteToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,45--56,54)"; ] @@ -1261,9 +1261,9 @@ let ``Test Operator Declarations for Int16`` () = "let testInt16ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,45--42,53)"; "let testInt16ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,45--43,53)"; "let testInt16ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,45--44,54)"; - "let testInt16ToIntOperator(e1) = e1 @ (45,45--45,51)"; - "let testInt16ToInt32Operator(e1) = e1 @ (46,45--46,53)"; - "let testInt16ToUInt32Operator(e1) = e1 @ (47,45--47,54)"; + "let testInt16ToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,45--45,51)"; + "let testInt16ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,45--46,53)"; + "let testInt16ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,45--47,54)"; "let testInt16ToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,45--48,53)"; "let testInt16ToUInt64Operator(e1) = Operators.ToInt64 (e1) @ (49,45--49,54)"; "let testInt16ToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,45--50,57)"; @@ -1271,7 +1271,7 @@ let ``Test Operator Declarations for Int16`` () = "let testInt16ToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,45--52,55)"; "let testInt16ToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,45--53,53)"; "let testInt16ToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,45--54,55)"; - "let testInt16ToCharOperator(e1) = Operators.ToUInt16 (e1) @ (55,45--55,52)"; + "let testInt16ToCharOperator(e1) = Operators.ToChar (e1) @ (55,45--55,52)"; "let testInt16ToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,45--56,54)"; ] @@ -1380,7 +1380,7 @@ let ``Test Operator Declarations for UInt16`` () = "let testUInt16ToSingleOperator(e1) = Operators.ToSingle (Operators.ToDouble (e1)) @ (52,47--52,57)"; "let testUInt16ToDoubleOperator(e1) = Operators.ToDouble (Operators.ToDouble (e1)) @ (53,47--53,55)"; "let testUInt16ToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,47--54,57)"; - "let testUInt16ToCharOperator(e1) = Operators.ToUInt16 (e1) @ (55,47--55,54)"; + "let testUInt16ToCharOperator(e1) = Operators.ToChar (e1) @ (55,47--55,54)"; "let testUInt16ToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,47--56,56)"; ] @@ -1482,7 +1482,7 @@ let ``Test Operator Declarations for Int`` () = "let testIntToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,41--44,50)"; "let testIntToIntOperator(e1) = e1 @ (45,45--45,47)"; "let testIntToInt32Operator(e1) = e1 @ (46,47--46,49)"; - "let testIntToUInt32Operator(e1) = e1 @ (47,41--47,50)"; + "let testIntToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,41--47,50)"; "let testIntToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,41--48,49)"; "let testIntToUInt64Operator(e1) = Operators.ToInt64 (e1) @ (49,41--49,50)"; "let testIntToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,41--50,53)"; @@ -1490,7 +1490,7 @@ let ``Test Operator Declarations for Int`` () = "let testIntToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,41--52,51)"; "let testIntToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,41--53,49)"; "let testIntToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,41--54,51)"; - "let testIntToCharOperator(e1) = Operators.ToUInt16 (e1) @ (55,41--55,48)"; + "let testIntToCharOperator(e1) = Operators.ToChar (e1) @ (55,41--55,48)"; "let testIntToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,41--56,50)"; ] @@ -1592,7 +1592,7 @@ let ``Test Operator Declarations for Int32`` () = "let testInt32ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,45--44,54)"; "let testInt32ToIntOperator(e1) = e1 @ (45,49--45,51)"; "let testInt32ToInt32Operator(e1) = e1 @ (46,51--46,53)"; - "let testInt32ToUInt32Operator(e1) = e1 @ (47,45--47,54)"; + "let testInt32ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,45--47,54)"; "let testInt32ToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,45--48,53)"; "let testInt32ToUInt64Operator(e1) = Operators.ToInt64 (e1) @ (49,45--49,54)"; "let testInt32ToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,45--50,57)"; @@ -1600,7 +1600,7 @@ let ``Test Operator Declarations for Int32`` () = "let testInt32ToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,45--52,55)"; "let testInt32ToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,45--53,53)"; "let testInt32ToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,45--54,55)"; - "let testInt32ToCharOperator(e1) = Operators.ToUInt16 (e1) @ (55,45--55,52)"; + "let testInt32ToCharOperator(e1) = Operators.ToChar (e1) @ (55,45--55,52)"; "let testInt32ToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,45--56,54)"; ] @@ -1699,8 +1699,8 @@ let ``Test Operator Declarations for UInt32`` () = "let testUInt32ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,47--42,55)"; "let testUInt32ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,47--43,55)"; "let testUInt32ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,47--44,56)"; - "let testUInt32ToIntOperator(e1) = e1 @ (45,47--45,53)"; - "let testUInt32ToInt32Operator(e1) = e1 @ (46,47--46,55)"; + "let testUInt32ToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,47--45,53)"; + "let testUInt32ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,47--46,55)"; "let testUInt32ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,47--47,56)"; "let testUInt32ToInt64Operator(e1) = Operators.ToUInt64 (e1) @ (48,47--48,55)"; "let testUInt32ToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,47--49,56)"; @@ -1709,7 +1709,7 @@ let ``Test Operator Declarations for UInt32`` () = "let testUInt32ToSingleOperator(e1) = Operators.ToSingle (Operators.ToDouble (e1)) @ (52,47--52,57)"; "let testUInt32ToDoubleOperator(e1) = Operators.ToDouble (Operators.ToDouble (e1)) @ (53,47--53,55)"; "let testUInt32ToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,47--54,57)"; - "let testUInt32ToCharOperator(e1) = Operators.ToUInt16 (e1) @ (55,47--55,54)"; + "let testUInt32ToCharOperator(e1) = Operators.ToChar (e1) @ (55,47--55,54)"; "let testUInt32ToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,47--56,56)"; ] @@ -1813,13 +1813,13 @@ let ``Test Operator Declarations for Int64`` () = "let testInt64ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,45--46,53)"; "let testInt64ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,45--47,54)"; "let testInt64ToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,45--48,53)"; - "let testInt64ToUInt64Operator(e1) = e1 @ (49,45--49,54)"; + "let testInt64ToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,45--49,54)"; "let testInt64ToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,45--50,57)"; "let testInt64ToUIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (51,45--51,58)"; "let testInt64ToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,45--52,55)"; "let testInt64ToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,45--53,53)"; "let testInt64ToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,45--54,55)"; - "let testInt64ToCharOperator(e1) = Operators.ToUInt16 (e1) @ (55,45--55,52)"; + "let testInt64ToCharOperator(e1) = Operators.ToChar (e1) @ (55,45--55,52)"; "let testInt64ToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,45--56,54)"; ] @@ -1921,14 +1921,14 @@ let ``Test Operator Declarations for UInt64`` () = "let testUInt64ToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,47--45,53)"; "let testUInt64ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,47--46,55)"; "let testUInt64ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,47--47,56)"; - "let testUInt64ToInt64Operator(e1) = e1 @ (48,47--48,55)"; + "let testUInt64ToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,47--48,55)"; "let testUInt64ToUInt64Operator(e1) = e1 @ (49,54--49,56)"; "let testUInt64ToIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (50,47--50,59)"; "let testUInt64ToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,47--51,60)"; "let testUInt64ToSingleOperator(e1) = Operators.ToSingle (Operators.ToDouble (e1)) @ (52,47--52,57)"; "let testUInt64ToDoubleOperator(e1) = Operators.ToDouble (Operators.ToDouble (e1)) @ (53,47--53,55)"; "let testUInt64ToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,47--54,57)"; - "let testUInt64ToCharOperator(e1) = Operators.ToUInt16 (e1) @ (55,47--55,54)"; + "let testUInt64ToCharOperator(e1) = Operators.ToChar (e1) @ (55,47--55,54)"; "let testUInt64ToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,47--56,56)"; ] @@ -2034,11 +2034,11 @@ let ``Test Operator Declarations for IntPtr`` () = "let testIntPtrToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,50--48,58)"; "let testIntPtrToUInt64Operator(e1) = Operators.ToInt64 (e1) @ (49,50--49,59)"; "let testIntPtrToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,50--50,62)"; - "let testIntPtrToUIntPtrOperator(e1) = e1 @ (51,50--51,63)"; + "let testIntPtrToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,50--51,63)"; "let testIntPtrToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,50--52,60)"; "let testIntPtrToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,50--53,58)"; "let testIntPtrToDecimalOperator(e1) = Convert.ToDecimal (Operators.ToInt64 (e1)) @ (54,50--54,60)"; - "let testIntPtrToCharOperator(e1) = Operators.ToUInt16 (e1) @ (55,50--55,57)"; + "let testIntPtrToCharOperator(e1) = Operators.ToChar (e1) @ (55,50--55,57)"; "let testIntPtrToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,50--56,59)"; ] @@ -2142,12 +2142,12 @@ let ``Test Operator Declarations for UIntPtr`` () = "let testUIntPtrToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,52--47,61)"; "let testUIntPtrToInt64Operator(e1) = Operators.ToUInt64 (e1) @ (48,52--48,60)"; "let testUIntPtrToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,52--49,61)"; - "let testUIntPtrToIntPtrOperator(e1) = e1 @ (50,52--50,64)"; + "let testUIntPtrToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,52--50,64)"; "let testUIntPtrToUIntPtrOperator(e1) = e1 @ (51,63--51,65)"; "let testUIntPtrToSingleOperator(e1) = Operators.ToSingle (Operators.ToDouble (e1)) @ (52,52--52,62)"; "let testUIntPtrToDoubleOperator(e1) = Operators.ToDouble (Operators.ToDouble (e1)) @ (53,52--53,60)"; "let testUIntPtrToDecimalOperator(e1) = Convert.ToDecimal (Operators.ToUInt64 (e1)) @ (54,52--54,62)"; - "let testUIntPtrToCharOperator(e1) = Operators.ToUInt16 (e1) @ (55,52--55,59)"; + "let testUIntPtrToCharOperator(e1) = Operators.ToChar (e1) @ (55,52--55,59)"; "let testUIntPtrToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,52--56,61)"; ] @@ -2253,7 +2253,7 @@ let ``Test Operator Declarations for Single`` () = "let testSingleToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,48--52,58)"; "let testSingleToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,48--53,56)"; "let testSingleToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,48--54,58)"; - "let testSingleToCharOperator(e1) = Operators.ToUInt16 (e1) @ (55,48--55,55)"; + "let testSingleToCharOperator(e1) = Operators.ToChar (e1) @ (55,48--55,55)"; "let testSingleToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,48--56,57)"; ] @@ -2359,7 +2359,7 @@ let ``Test Operator Declarations for Double`` () = "let testDoubleToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,46--52,56)"; "let testDoubleToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,46--53,54)"; "let testDoubleToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,46--54,56)"; - "let testDoubleToCharOperator(e1) = Operators.ToUInt16 (e1) @ (55,46--55,53)"; + "let testDoubleToCharOperator(e1) = Operators.ToChar (e1) @ (55,46--55,53)"; "let testDoubleToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,46--56,55)"; ] @@ -2528,8 +2528,8 @@ let ``Test Operator Declarations for Char`` () = "let testCharLessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,64--7,73)"; "let testCharGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,64--8,72)"; "let testCharGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,64--9,73)"; - "let testCharAdditionOperator(e1) (e2) = Operators.ToUInt16 (Operators.op_Addition (e1,e2)) @ (11,56--11,64)"; - "let testCharAdditionChecked(e1) (e2) = Checked.ToUInt16 (Checked.op_Addition (e1,e2)) @ (24,53--24,70)"; + "let testCharAdditionOperator(e1) (e2) = Operators.ToChar (Operators.op_Addition (e1,e2)) @ (11,56--11,64)"; + "let testCharAdditionChecked(e1) (e2) = Operators.ToChar (Checked.op_Addition (e1,e2)) @ (24,53--24,70)"; "let testCharToByteChecked(e1) = Checked.ToByte (e1) @ (29,43--29,58)"; "let testCharToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,43--30,59)"; "let testCharToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,43--31,59)"; @@ -2554,7 +2554,7 @@ let ``Test Operator Declarations for Char`` () = "let testCharToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,43--51,56)"; "let testCharToSingleOperator(e1) = Operators.ToSingle (Operators.ToDouble (e1)) @ (52,43--52,53)"; "let testCharToDoubleOperator(e1) = Operators.ToDouble (Operators.ToDouble (e1)) @ (53,43--53,51)"; - "let testCharToCharOperator(e1) = Operators.ToUInt16 (e1) @ (55,43--55,50)"; + "let testCharToCharOperator(e1) = Operators.ToChar (e1) @ (55,43--55,50)"; "let testCharToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,43--56,52)"; ]