@@ -10033,7 +10033,7 @@ let EvalArithUnOp (opInt8, opInt16, opInt32, opInt64, opUInt8, opUInt16, opUInt3
10033
10033
| _ -> error (Error ( FSComp.SR.tastNotAConstantExpression(), m))
10034
10034
with :? System.OverflowException -> error (Error ( FSComp.SR.tastConstantExpressionOverflow(), m))
10035
10035
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) =
10037
10037
// At compile-time we check arithmetic
10038
10038
let m = unionRanges arg1.Range arg2.Range
10039
10039
try
@@ -10048,6 +10048,7 @@ let EvalArithBinOp (opInt8, opInt16, opInt32, opInt64, opUInt8, opUInt16, opUInt
10048
10048
| Expr.Const (Const.UInt64 x1, _, ty), Expr.Const (Const.UInt64 x2, _, _) -> Expr.Const (Const.UInt64 (opUInt64 x1 x2), m, ty)
10049
10049
| Expr.Const (Const.Single x1, _, ty), Expr.Const (Const.Single x2, _, _) -> Expr.Const (Const.Single (opSingle x1 x2), m, ty)
10050
10050
| 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)
10051
10052
| _ -> error (Error ( FSComp.SR.tastNotAConstantExpression(), m))
10052
10053
with :? System.OverflowException -> error (Error ( FSComp.SR.tastConstantExpressionOverflow(), m))
10053
10054
@@ -10079,9 +10080,10 @@ let rec EvalAttribArgExpr suppressLangFeatureCheck (g: TcGlobals) (x: Expr) =
10079
10080
| Const.Single _
10080
10081
| Const.Char _
10081
10082
| Const.Zero
10082
- | Const.String _ ->
10083
+ | Const.String _
10084
+ | Const.Decimal _ ->
10083
10085
x
10084
- | Const.Decimal _ | Const. IntPtr _ | Const.UIntPtr _ | Const.Unit ->
10086
+ | Const.IntPtr _ | Const.UIntPtr _ | Const.Unit ->
10085
10087
errorR (Error ( FSComp.SR.tastNotAConstantExpression(), m))
10086
10088
x
10087
10089
@@ -10097,7 +10099,7 @@ let rec EvalAttribArgExpr suppressLangFeatureCheck (g: TcGlobals) (x: Expr) =
10097
10099
10098
10100
match v1 with
10099
10101
| IntegerConstExpr ->
10100
- EvalArithBinOp ((|||), (|||), (|||), (|||), (|||), (|||), (|||), (|||), ignore2, ignore2) v1 (EvalAttribArgExpr suppressLangFeatureCheck g arg2)
10102
+ EvalArithBinOp ((|||), (|||), (|||), (|||), (|||), (|||), (|||), (|||), ignore2, ignore2, ignore2 ) v1 (EvalAttribArgExpr suppressLangFeatureCheck g arg2)
10101
10103
| _ ->
10102
10104
errorR (Error ( FSComp.SR.tastNotAConstantExpression(), x.Range))
10103
10105
x
@@ -10112,7 +10114,7 @@ let rec EvalAttribArgExpr suppressLangFeatureCheck (g: TcGlobals) (x: Expr) =
10112
10114
Expr.Const (Const.Char (x1 + x2), m, ty)
10113
10115
| _ ->
10114
10116
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
10116
10118
| SpecificBinopExpr g g.unchecked_subtraction_vref (arg1, arg2) ->
10117
10119
checkFeature()
10118
10120
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) =
10121
10123
| Expr.Const (Const.Char x1, m, ty), Expr.Const (Const.Char x2, _, _) ->
10122
10124
Expr.Const (Const.Char (x1 - x2), m, ty)
10123
10125
| _ ->
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
10125
10127
| SpecificBinopExpr g g.unchecked_multiply_vref (arg1, arg2) ->
10126
10128
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)
10128
10130
| SpecificBinopExpr g g.unchecked_division_vref (arg1, arg2) ->
10129
10131
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)
10131
10133
| SpecificBinopExpr g g.unchecked_modulus_vref (arg1, arg2) ->
10132
10134
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)
10134
10136
| SpecificBinopExpr g g.bitwise_shift_left_vref (arg1, arg2) ->
10135
10137
checkFeature()
10136
10138
EvalArithShiftOp ((<<<), (<<<), (<<<), (<<<), (<<<), (<<<), (<<<), (<<<)) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg1) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
@@ -10143,7 +10145,7 @@ let rec EvalAttribArgExpr suppressLangFeatureCheck (g: TcGlobals) (x: Expr) =
10143
10145
10144
10146
match v1 with
10145
10147
| IntegerConstExpr ->
10146
- EvalArithBinOp ((&&&), (&&&), (&&&), (&&&), (&&&), (&&&), (&&&), (&&&), ignore2, ignore2) v1 (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
10148
+ EvalArithBinOp ((&&&), (&&&), (&&&), (&&&), (&&&), (&&&), (&&&), (&&&), ignore2, ignore2, ignore2 ) v1 (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
10147
10149
| _ ->
10148
10150
errorR (Error ( FSComp.SR.tastNotAConstantExpression(), x.Range))
10149
10151
x
@@ -10153,7 +10155,7 @@ let rec EvalAttribArgExpr suppressLangFeatureCheck (g: TcGlobals) (x: Expr) =
10153
10155
10154
10156
match v1 with
10155
10157
| IntegerConstExpr ->
10156
- EvalArithBinOp ((^^^), (^^^), (^^^), (^^^), (^^^), (^^^), (^^^), (^^^), ignore2, ignore2) v1 (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
10158
+ EvalArithBinOp ((^^^), (^^^), (^^^), (^^^), (^^^), (^^^), (^^^), (^^^), ignore2, ignore2, ignore2 ) v1 (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
10157
10159
| _ ->
10158
10160
errorR (Error (FSComp.SR.tastNotAConstantExpression(), x.Range))
10159
10161
x
@@ -10163,7 +10165,7 @@ let rec EvalAttribArgExpr suppressLangFeatureCheck (g: TcGlobals) (x: Expr) =
10163
10165
10164
10166
match v1 with
10165
10167
| 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)
10167
10169
| _ ->
10168
10170
errorR (Error (FSComp.SR.tastNotAConstantExpression(), x.Range))
10169
10171
x
0 commit comments