Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Safar <marek.safar@gmail.com>2014-07-14 16:45:13 +0400
committerMarek Safar <marek.safar@gmail.com>2014-07-15 16:40:05 +0400
commitf540f8ac339f7e833398c21516dd91dfc9b0dca5 (patch)
tree1af79262c453035d35f3c74d24863c9d884840e6
parentc46cf0e4595347a2ed62371b067fbc6c6f745b8b (diff)
[mcs] Handling CreateStandardLiftedOperatorsTable for corlib without nullable typemono-3.6.0.39mono-3.6.0
-rw-r--r--mcs/mcs/expression.cs23
1 files changed, 14 insertions, 9 deletions
diff --git a/mcs/mcs/expression.cs b/mcs/mcs/expression.cs
index c4c7168483b..6976b97c8b1 100644
--- a/mcs/mcs/expression.cs
+++ b/mcs/mcs/expression.cs
@@ -3159,11 +3159,21 @@ namespace Mono.CSharp
}
public static PredefinedOperator[] CreateStandardLiftedOperatorsTable (ModuleContainer module)
{
+ var types = module.Compiler.BuiltinTypes;
+
+ //
+ // Not strictly lifted but need to be in second group otherwise expressions like
+ // int + null would resolve to +(object, string) instead of +(int?, int?)
+ //
+ var string_operators = new [] {
+ new PredefinedStringOperator (types.String, types.Object, Operator.AdditionMask, types.String),
+ new PredefinedStringOperator (types.Object, types.String, Operator.AdditionMask, types.String),
+ };
+
var nullable = module.PredefinedTypes.Nullable.TypeSpec;
if (nullable == null)
- return new PredefinedOperator [0];
+ return string_operators;
- var types = module.Compiler.BuiltinTypes;
var bool_type = types.Bool;
var nullable_bool = nullable.MakeGenericType (module, new[] { bool_type });
@@ -3198,13 +3208,8 @@ namespace Mono.CSharp
new PredefinedOperator (nullable_long, nullable_int, Operator.NullableMask | Operator.ShiftMask),
new PredefinedOperator (nullable_ulong, nullable_int, Operator.NullableMask | Operator.ShiftMask),
- //
- // Not strictly lifted but need to be in second group otherwise expressions like
- // int + null would resolve to +(object, string) instead of +(int?, int?)
- //
- new PredefinedStringOperator (types.String, types.Object, Operator.AdditionMask, types.String),
- new PredefinedStringOperator (types.Object, types.String, Operator.AdditionMask, types.String),
-
+ string_operators [0],
+ string_operators [1]
};
}