@@ -10033,7 +10033,7 @@ let EvalArithUnOp (opInt8, opInt16, opInt32, opInt64, opUInt8, opUInt16, opUInt3
1003310033 | _ -> error (Error ( FSComp.SR.tastNotAConstantExpression(), m))
1003410034 with :? System.OverflowException -> error (Error ( FSComp.SR.tastConstantExpressionOverflow(), m))
1003510035
10036- let EvalArithBinOp (opInt8, opInt16, opInt32, opInt64, opUInt8, opUInt16, opUInt32, opUInt64, opSingle, opDouble) (arg1: Expr) (arg2: Expr) =
10036+ let EvalArithBinOp (opInt8, opInt16, opInt32, opInt64, opUInt8, opUInt16, opUInt32, opUInt64, opSingle, opDouble, opDecimal ) (arg1: Expr) (arg2: Expr) =
1003710037 // At compile-time we check arithmetic
1003810038 let m = unionRanges arg1.Range arg2.Range
1003910039 try
@@ -10048,6 +10048,7 @@ let EvalArithBinOp (opInt8, opInt16, opInt32, opInt64, opUInt8, opUInt16, opUInt
1004810048 | Expr.Const (Const.UInt64 x1, _, ty), Expr.Const (Const.UInt64 x2, _, _) -> Expr.Const (Const.UInt64 (opUInt64 x1 x2), m, ty)
1004910049 | Expr.Const (Const.Single x1, _, ty), Expr.Const (Const.Single x2, _, _) -> Expr.Const (Const.Single (opSingle x1 x2), m, ty)
1005010050 | Expr.Const (Const.Double x1, _, ty), Expr.Const (Const.Double x2, _, _) -> Expr.Const (Const.Double (opDouble x1 x2), m, ty)
10051+ | Expr.Const (Const.Decimal x1, _, ty), Expr.Const (Const.Decimal x2, _, _) -> Expr.Const (Const.Decimal (opDecimal x1 x2), m, ty)
1005110052 | _ -> error (Error ( FSComp.SR.tastNotAConstantExpression(), m))
1005210053 with :? System.OverflowException -> error (Error ( FSComp.SR.tastConstantExpressionOverflow(), m))
1005310054
@@ -10079,9 +10080,10 @@ let rec EvalAttribArgExpr suppressLangFeatureCheck (g: TcGlobals) (x: Expr) =
1007910080 | Const.Single _
1008010081 | Const.Char _
1008110082 | Const.Zero
10082- | Const.String _ ->
10083+ | Const.String _
10084+ | Const.Decimal _ ->
1008310085 x
10084- | Const.Decimal _ | Const. IntPtr _ | Const.UIntPtr _ | Const.Unit ->
10086+ | Const.IntPtr _ | Const.UIntPtr _ | Const.Unit ->
1008510087 errorR (Error ( FSComp.SR.tastNotAConstantExpression(), m))
1008610088 x
1008710089
@@ -10097,7 +10099,7 @@ let rec EvalAttribArgExpr suppressLangFeatureCheck (g: TcGlobals) (x: Expr) =
1009710099
1009810100 match v1 with
1009910101 | IntegerConstExpr ->
10100- EvalArithBinOp ((|||), (|||), (|||), (|||), (|||), (|||), (|||), (|||), ignore2, ignore2) v1 (EvalAttribArgExpr suppressLangFeatureCheck g arg2)
10102+ EvalArithBinOp ((|||), (|||), (|||), (|||), (|||), (|||), (|||), (|||), ignore2, ignore2, ignore2 ) v1 (EvalAttribArgExpr suppressLangFeatureCheck g arg2)
1010110103 | _ ->
1010210104 errorR (Error ( FSComp.SR.tastNotAConstantExpression(), x.Range))
1010310105 x
@@ -10112,7 +10114,7 @@ let rec EvalAttribArgExpr suppressLangFeatureCheck (g: TcGlobals) (x: Expr) =
1011210114 Expr.Const (Const.Char (x1 + x2), m, ty)
1011310115 | _ ->
1011410116 checkFeature()
10115- EvalArithBinOp (Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+)) v1 v2
10117+ EvalArithBinOp (Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+) ) v1 v2
1011610118 | SpecificBinopExpr g g.unchecked_subtraction_vref (arg1, arg2) ->
1011710119 checkFeature()
1011810120 let v1, v2 = EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg1, EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2
@@ -10121,16 +10123,16 @@ let rec EvalAttribArgExpr suppressLangFeatureCheck (g: TcGlobals) (x: Expr) =
1012110123 | Expr.Const (Const.Char x1, m, ty), Expr.Const (Const.Char x2, _, _) ->
1012210124 Expr.Const (Const.Char (x1 - x2), m, ty)
1012310125 | _ ->
10124- EvalArithBinOp (Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-)) v1 v2
10126+ EvalArithBinOp (Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-) ) v1 v2
1012510127 | SpecificBinopExpr g g.unchecked_multiply_vref (arg1, arg2) ->
1012610128 checkFeature()
10127- EvalArithBinOp (Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*)) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg1) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
10129+ EvalArithBinOp (Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*) ) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg1) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
1012810130 | SpecificBinopExpr g g.unchecked_division_vref (arg1, arg2) ->
1012910131 checkFeature()
10130- EvalArithBinOp ((/), (/), (/), (/), (/), (/), (/), (/), (/), (/)) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg1) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
10132+ EvalArithBinOp ((/), (/), (/), (/), (/), (/), (/), (/), (/), (/), (/) ) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg1) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
1013110133 | SpecificBinopExpr g g.unchecked_modulus_vref (arg1, arg2) ->
1013210134 checkFeature()
10133- EvalArithBinOp ((%), (%), (%), (%), (%), (%), (%), (%), (%), (%)) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg1) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
10135+ EvalArithBinOp ((%), (%), (%), (%), (%), (%), (%), (%), (%), (%), (%) ) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg1) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
1013410136 | SpecificBinopExpr g g.bitwise_shift_left_vref (arg1, arg2) ->
1013510137 checkFeature()
1013610138 EvalArithShiftOp ((<<<), (<<<), (<<<), (<<<), (<<<), (<<<), (<<<), (<<<)) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg1) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
@@ -10143,7 +10145,7 @@ let rec EvalAttribArgExpr suppressLangFeatureCheck (g: TcGlobals) (x: Expr) =
1014310145
1014410146 match v1 with
1014510147 | IntegerConstExpr ->
10146- EvalArithBinOp ((&&&), (&&&), (&&&), (&&&), (&&&), (&&&), (&&&), (&&&), ignore2, ignore2) v1 (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
10148+ EvalArithBinOp ((&&&), (&&&), (&&&), (&&&), (&&&), (&&&), (&&&), (&&&), ignore2, ignore2, ignore2 ) v1 (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
1014710149 | _ ->
1014810150 errorR (Error ( FSComp.SR.tastNotAConstantExpression(), x.Range))
1014910151 x
@@ -10153,7 +10155,7 @@ let rec EvalAttribArgExpr suppressLangFeatureCheck (g: TcGlobals) (x: Expr) =
1015310155
1015410156 match v1 with
1015510157 | IntegerConstExpr ->
10156- EvalArithBinOp ((^^^), (^^^), (^^^), (^^^), (^^^), (^^^), (^^^), (^^^), ignore2, ignore2) v1 (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
10158+ EvalArithBinOp ((^^^), (^^^), (^^^), (^^^), (^^^), (^^^), (^^^), (^^^), ignore2, ignore2, ignore2 ) v1 (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
1015710159 | _ ->
1015810160 errorR (Error (FSComp.SR.tastNotAConstantExpression(), x.Range))
1015910161 x
@@ -10163,7 +10165,7 @@ let rec EvalAttribArgExpr suppressLangFeatureCheck (g: TcGlobals) (x: Expr) =
1016310165
1016410166 match v1 with
1016510167 | FloatConstExpr ->
10166- EvalArithBinOp (ignore2, ignore2, ignore2, ignore2, ignore2, ignore2, ignore2, ignore2, ( ** ), ( ** )) v1 (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
10168+ EvalArithBinOp (ignore2, ignore2, ignore2, ignore2, ignore2, ignore2, ignore2, ignore2, ( ** ), ( ** ), ignore2 ) v1 (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
1016710169 | _ ->
1016810170 errorR (Error (FSComp.SR.tastNotAConstantExpression(), x.Range))
1016910171 x
0 commit comments