@@ -10014,7 +10014,7 @@ let EvalArithUnOp (opInt8, opInt16, opInt32, opInt64, opUInt8, opUInt16, opUInt3
10014
10014
| _ -> error (Error ( FSComp.SR.tastNotAConstantExpression(), m))
10015
10015
with :? System.OverflowException -> error (Error ( FSComp.SR.tastConstantExpressionOverflow(), m))
10016
10016
10017
- let EvalArithBinOp (opInt8, opInt16, opInt32, opInt64, opUInt8, opUInt16, opUInt32, opUInt64, opSingle, opDouble) (arg1: Expr) (arg2: Expr) =
10017
+ let EvalArithBinOp (opInt8, opInt16, opInt32, opInt64, opUInt8, opUInt16, opUInt32, opUInt64, opSingle, opDouble, opDecimal ) (arg1: Expr) (arg2: Expr) =
10018
10018
// At compile-time we check arithmetic
10019
10019
let m = unionRanges arg1.Range arg2.Range
10020
10020
try
@@ -10029,6 +10029,7 @@ let EvalArithBinOp (opInt8, opInt16, opInt32, opInt64, opUInt8, opUInt16, opUInt
10029
10029
| Expr.Const (Const.UInt64 x1, _, ty), Expr.Const (Const.UInt64 x2, _, _) -> Expr.Const (Const.UInt64 (opUInt64 x1 x2), m, ty)
10030
10030
| Expr.Const (Const.Single x1, _, ty), Expr.Const (Const.Single x2, _, _) -> Expr.Const (Const.Single (opSingle x1 x2), m, ty)
10031
10031
| Expr.Const (Const.Double x1, _, ty), Expr.Const (Const.Double x2, _, _) -> Expr.Const (Const.Double (opDouble x1 x2), m, ty)
10032
+ | Expr.Const (Const.Decimal x1, _, ty), Expr.Const (Const.Decimal x2, _, _) -> Expr.Const (Const.Decimal (opDecimal x1 x2), m, ty)
10032
10033
| _ -> error (Error ( FSComp.SR.tastNotAConstantExpression(), m))
10033
10034
with :? System.OverflowException -> error (Error ( FSComp.SR.tastConstantExpressionOverflow(), m))
10034
10035
@@ -10060,9 +10061,10 @@ let rec EvalAttribArgExpr suppressLangFeatureCheck (g: TcGlobals) (x: Expr) =
10060
10061
| Const.Single _
10061
10062
| Const.Char _
10062
10063
| Const.Zero
10063
- | Const.String _ ->
10064
+ | Const.String _
10065
+ | Const.Decimal _ ->
10064
10066
x
10065
- | Const.Decimal _ | Const. IntPtr _ | Const.UIntPtr _ | Const.Unit ->
10067
+ | Const.IntPtr _ | Const.UIntPtr _ | Const.Unit ->
10066
10068
errorR (Error ( FSComp.SR.tastNotAConstantExpression(), m))
10067
10069
x
10068
10070
@@ -10078,7 +10080,7 @@ let rec EvalAttribArgExpr suppressLangFeatureCheck (g: TcGlobals) (x: Expr) =
10078
10080
10079
10081
match v1 with
10080
10082
| IntegerConstExpr ->
10081
- EvalArithBinOp ((|||), (|||), (|||), (|||), (|||), (|||), (|||), (|||), ignore2, ignore2) v1 (EvalAttribArgExpr suppressLangFeatureCheck g arg2)
10083
+ EvalArithBinOp ((|||), (|||), (|||), (|||), (|||), (|||), (|||), (|||), ignore2, ignore2, ignore2 ) v1 (EvalAttribArgExpr suppressLangFeatureCheck g arg2)
10082
10084
| _ ->
10083
10085
errorR (Error ( FSComp.SR.tastNotAConstantExpression(), x.Range))
10084
10086
x
@@ -10093,7 +10095,7 @@ let rec EvalAttribArgExpr suppressLangFeatureCheck (g: TcGlobals) (x: Expr) =
10093
10095
Expr.Const (Const.Char (x1 + x2), m, ty)
10094
10096
| _ ->
10095
10097
checkFeature()
10096
- EvalArithBinOp (Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+)) v1 v2
10098
+ EvalArithBinOp (Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+), Checked.(+) ) v1 v2
10097
10099
| SpecificBinopExpr g g.unchecked_subtraction_vref (arg1, arg2) ->
10098
10100
checkFeature()
10099
10101
let v1, v2 = EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg1, EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2
@@ -10102,16 +10104,16 @@ let rec EvalAttribArgExpr suppressLangFeatureCheck (g: TcGlobals) (x: Expr) =
10102
10104
| Expr.Const (Const.Char x1, m, ty), Expr.Const (Const.Char x2, _, _) ->
10103
10105
Expr.Const (Const.Char (x1 - x2), m, ty)
10104
10106
| _ ->
10105
- EvalArithBinOp (Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-)) v1 v2
10107
+ EvalArithBinOp (Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-), Checked.(-) ) v1 v2
10106
10108
| SpecificBinopExpr g g.unchecked_multiply_vref (arg1, arg2) ->
10107
10109
checkFeature()
10108
- EvalArithBinOp (Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*)) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg1) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
10110
+ EvalArithBinOp (Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*), Checked.(*) ) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg1) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
10109
10111
| SpecificBinopExpr g g.unchecked_division_vref (arg1, arg2) ->
10110
10112
checkFeature()
10111
- EvalArithBinOp ((/), (/), (/), (/), (/), (/), (/), (/), (/), (/)) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg1) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
10113
+ EvalArithBinOp ((/), (/), (/), (/), (/), (/), (/), (/), (/), (/), (/) ) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg1) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
10112
10114
| SpecificBinopExpr g g.unchecked_modulus_vref (arg1, arg2) ->
10113
10115
checkFeature()
10114
- EvalArithBinOp ((%), (%), (%), (%), (%), (%), (%), (%), (%), (%)) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg1) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
10116
+ EvalArithBinOp ((%), (%), (%), (%), (%), (%), (%), (%), (%), (%), (%) ) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg1) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
10115
10117
| SpecificBinopExpr g g.bitwise_shift_left_vref (arg1, arg2) ->
10116
10118
checkFeature()
10117
10119
EvalArithShiftOp ((<<<), (<<<), (<<<), (<<<), (<<<), (<<<), (<<<), (<<<)) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg1) (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
@@ -10124,7 +10126,7 @@ let rec EvalAttribArgExpr suppressLangFeatureCheck (g: TcGlobals) (x: Expr) =
10124
10126
10125
10127
match v1 with
10126
10128
| IntegerConstExpr ->
10127
- EvalArithBinOp ((&&&), (&&&), (&&&), (&&&), (&&&), (&&&), (&&&), (&&&), ignore2, ignore2) v1 (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
10129
+ EvalArithBinOp ((&&&), (&&&), (&&&), (&&&), (&&&), (&&&), (&&&), (&&&), ignore2, ignore2, ignore2 ) v1 (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
10128
10130
| _ ->
10129
10131
errorR (Error ( FSComp.SR.tastNotAConstantExpression(), x.Range))
10130
10132
x
@@ -10134,7 +10136,7 @@ let rec EvalAttribArgExpr suppressLangFeatureCheck (g: TcGlobals) (x: Expr) =
10134
10136
10135
10137
match v1 with
10136
10138
| IntegerConstExpr ->
10137
- EvalArithBinOp ((^^^), (^^^), (^^^), (^^^), (^^^), (^^^), (^^^), (^^^), ignore2, ignore2) v1 (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
10139
+ EvalArithBinOp ((^^^), (^^^), (^^^), (^^^), (^^^), (^^^), (^^^), (^^^), ignore2, ignore2, ignore2 ) v1 (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
10138
10140
| _ ->
10139
10141
errorR (Error (FSComp.SR.tastNotAConstantExpression(), x.Range))
10140
10142
x
@@ -10144,7 +10146,7 @@ let rec EvalAttribArgExpr suppressLangFeatureCheck (g: TcGlobals) (x: Expr) =
10144
10146
10145
10147
match v1 with
10146
10148
| FloatConstExpr ->
10147
- EvalArithBinOp (ignore2, ignore2, ignore2, ignore2, ignore2, ignore2, ignore2, ignore2, ( ** ), ( ** )) v1 (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
10149
+ EvalArithBinOp (ignore2, ignore2, ignore2, ignore2, ignore2, ignore2, ignore2, ignore2, ( ** ), ( ** ), ignore2 ) v1 (EvalAttribArgExpr SuppressLanguageFeatureCheck.Yes g arg2)
10148
10150
| _ ->
10149
10151
errorR (Error (FSComp.SR.tastNotAConstantExpression(), x.Range))
10150
10152
x
0 commit comments