@@ -10020,7 +10020,7 @@ let EvalArithUnOp (opInt8, opInt16, opInt32, opInt64, opUInt8, opUInt16, opUInt3
10020
10020
| _ -> error (Error ( FSComp.SR.tastNotAConstantExpression(), m))
10021
10021
with :? System.OverflowException -> error (Error ( FSComp.SR.tastConstantExpressionOverflow(), m))
10022
10022
10023
- let EvalArithBinOp (opInt8, opInt16, opInt32, opInt64, opUInt8, opUInt16, opUInt32, opUInt64, opSingle, opDouble) (arg1: Expr) (arg2: Expr) =
10023
+ let EvalArithBinOp (opInt8, opInt16, opInt32, opInt64, opUInt8, opUInt16, opUInt32, opUInt64, opSingle, opDouble, opDecimal ) (arg1: Expr) (arg2: Expr) =
10024
10024
// At compile-time we check arithmetic
10025
10025
let m = unionRanges arg1.Range arg2.Range
10026
10026
try
@@ -10035,6 +10035,7 @@ let EvalArithBinOp (opInt8, opInt16, opInt32, opInt64, opUInt8, opUInt16, opUInt
10035
10035
| Expr.Const (Const.UInt64 x1, _, ty), Expr.Const (Const.UInt64 x2, _, _) -> Expr.Const (Const.UInt64 (opUInt64 x1 x2), m, ty)
10036
10036
| Expr.Const (Const.Single x1, _, ty), Expr.Const (Const.Single x2, _, _) -> Expr.Const (Const.Single (opSingle x1 x2), m, ty)
10037
10037
| Expr.Const (Const.Double x1, _, ty), Expr.Const (Const.Double x2, _, _) -> Expr.Const (Const.Double (opDouble x1 x2), m, ty)
10038
+ | Expr.Const (Const.Decimal x1, _, ty), Expr.Const (Const.Decimal x2, _, _) -> Expr.Const (Const.Decimal (opDecimal x1 x2), m, ty)
10038
10039
| _ -> error (Error ( FSComp.SR.tastNotAConstantExpression(), m))
10039
10040
with :? System.OverflowException -> error (Error ( FSComp.SR.tastConstantExpressionOverflow(), m))
10040
10041
@@ -10066,9 +10067,10 @@ let rec EvalAttribArgExpr suppressLangFeatureCheck (g: TcGlobals) (x: Expr) =
10066
10067
| Const.Single _
10067
10068
| Const.Char _
10068
10069
| Const.Zero
10069
- | Const.String _ ->
10070
+ | Const.String _
10071
+ | Const.Decimal _ ->
10070
10072
x
10071
- | Const.Decimal _ | Const. IntPtr _ | Const.UIntPtr _ | Const.Unit ->
10073
+ | Const.IntPtr _ | Const.UIntPtr _ | Const.Unit ->
10072
10074
errorR (Error ( FSComp.SR.tastNotAConstantExpression(), m))
10073
10075
x
10074
10076
@@ -10084,7 +10086,7 @@ let rec EvalAttribArgExpr suppressLangFeatureCheck (g: TcGlobals) (x: Expr) =
10084
10086
10085
10087
match v1 with
10086
10088
| IntegerConstExpr ->
10087
- EvalArithBinOp ((|||), (|||), (|||), (|||), (|||), (|||), (|||), (|||), ignore2, ignore2) v1 (EvalAttribArgExpr suppressLangFeatureCheck g arg2)
10089
+ EvalArithBinOp ((|||), (|||), (|||), (|||), (|||), (|||), (|||), (|||), ignore2, ignore2, ignore2 ) v1 (EvalAttribArgExpr suppressLangFeatureCheck g arg2)
10088
10090
| _ ->
10089
10091
errorR (Error ( FSComp.SR.tastNotAConstantExpression(), x.Range))
10090
10092
x
@@ -10099,7 +10101,7 @@ let rec EvalAttribArgExpr suppressLangFeatureCheck (g: TcGlobals) (x: Expr) =
10099
10101
Expr.Const (Const.Char (x1 + x2), m, ty)
10100
10102
| _ ->
10101
10103
checkFeature()
10102
- EvalArithBinOp (Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+)) v1 v2
10104
+ EvalArithBinOp (Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+) ) v1 v2
10103
10105
| SpecificBinopExpr g g.unchecked_subtraction_vref (arg1, arg2) ->
10104
10106
checkFeature()
10105
10107
let v1, v2 = EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg1, EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2
@@ -10108,16 +10110,16 @@ let rec EvalAttribArgExpr suppressLangFeatureCheck (g: TcGlobals) (x: Expr) =
10108
10110
| Expr.Const (Const.Char x1, m, ty), Expr.Const (Const.Char x2, _, _) ->
10109
10111
Expr.Const (Const.Char (x1 - x2), m, ty)
10110
10112
| _ ->
10111
- EvalArithBinOp (Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-)) v1 v2
10113
+ EvalArithBinOp (Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-) ) v1 v2
10112
10114
| SpecificBinopExpr g g.unchecked_multiply_vref (arg1, arg2) ->
10113
10115
checkFeature()
10114
- EvalArithBinOp (Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*)) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg1) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
10116
+ EvalArithBinOp (Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*) ) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg1) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
10115
10117
| SpecificBinopExpr g g.unchecked_division_vref (arg1, arg2) ->
10116
10118
checkFeature()
10117
- EvalArithBinOp ((/), (/), (/), (/), (/), (/), (/), (/), (/), (/)) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg1) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
10119
+ EvalArithBinOp ((/), (/), (/), (/), (/), (/), (/), (/), (/), (/), (/) ) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg1) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
10118
10120
| SpecificBinopExpr g g.unchecked_modulus_vref (arg1, arg2) ->
10119
10121
checkFeature()
10120
- EvalArithBinOp ((%), (%), (%), (%), (%), (%), (%), (%), (%), (%)) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg1) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
10122
+ EvalArithBinOp ((%), (%), (%), (%), (%), (%), (%), (%), (%), (%), (%) ) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg1) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
10121
10123
| SpecificBinopExpr g g.bitwise_shift_left_vref (arg1, arg2) ->
10122
10124
checkFeature()
10123
10125
EvalArithShiftOp ((<<<), (<<<), (<<<), (<<<), (<<<), (<<<), (<<<), (<<<)) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg1) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
@@ -10130,7 +10132,7 @@ let rec EvalAttribArgExpr suppressLangFeatureCheck (g: TcGlobals) (x: Expr) =
10130
10132
10131
10133
match v1 with
10132
10134
| IntegerConstExpr ->
10133
- EvalArithBinOp ((&&&), (&&&), (&&&), (&&&), (&&&), (&&&), (&&&), (&&&), ignore2, ignore2) v1 (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
10135
+ EvalArithBinOp ((&&&), (&&&), (&&&), (&&&), (&&&), (&&&), (&&&), (&&&), ignore2, ignore2, ignore2 ) v1 (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
10134
10136
| _ ->
10135
10137
errorR (Error ( FSComp.SR.tastNotAConstantExpression(), x.Range))
10136
10138
x
@@ -10140,7 +10142,7 @@ let rec EvalAttribArgExpr suppressLangFeatureCheck (g: TcGlobals) (x: Expr) =
10140
10142
10141
10143
match v1 with
10142
10144
| IntegerConstExpr ->
10143
- EvalArithBinOp ((^^^), (^^^), (^^^), (^^^), (^^^), (^^^), (^^^), (^^^), ignore2, ignore2) v1 (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
10145
+ EvalArithBinOp ((^^^), (^^^), (^^^), (^^^), (^^^), (^^^), (^^^), (^^^), ignore2, ignore2, ignore2 ) v1 (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
10144
10146
| _ ->
10145
10147
errorR (Error (FSComp.SR.tastNotAConstantExpression(), x.Range))
10146
10148
x
@@ -10150,7 +10152,7 @@ let rec EvalAttribArgExpr suppressLangFeatureCheck (g: TcGlobals) (x: Expr) =
10150
10152
10151
10153
match v1 with
10152
10154
| FloatConstExpr ->
10153
- EvalArithBinOp (ignore2, ignore2, ignore2, ignore2, ignore2, ignore2, ignore2, ignore2, ( ** ), ( ** )) v1 (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
10155
+ EvalArithBinOp (ignore2, ignore2, ignore2, ignore2, ignore2, ignore2, ignore2, ignore2, ( ** ), ( ** ), ignore2 ) v1 (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
10154
10156
| _ ->
10155
10157
errorR (Error (FSComp.SR.tastNotAConstantExpression(), x.Range))
10156
10158
x
0 commit comments