* Expression.cs, UnaryExpression.cs, BinaryExpression.cs: Move the IsUnsigned helper from BinaryExpression to Expression, so it can be used in UnaryExpression. svn path=/trunk/mcs/; revision=93387
@@ -97,14 +97,6 @@ namespace System.Linq.Expressions {
this.is_lifted = is_lifted;
}
- static bool IsUnsigned (Type t)
- {
- if (t.IsPointer)
- return IsUnsigned (t.GetElementType ());
-
- return t == typeof (ushort) || t == typeof (uint) || t == typeof (ulong) || t == typeof (byte);
- }
static void EmitMethod ()
{
throw new NotImplementedException ("Support for MethodInfo-based BinaryExpressions not yet supported");
@@ -1,3 +1,9 @@
+2008-01-21 Jb Evain <[email protected]>
+
+ * Expression.cs, UnaryExpression.cs, BinaryExpression.cs:
+ Move the IsUnsigned helper from BinaryExpression to Expression,
+ so it can be used in UnaryExpression.
2008-01-21 Miguel de Icaza <[email protected]>
* Start code generation for nullables, currently this generates
@@ -1385,6 +1385,14 @@ namespace System.Linq.Expressions {
return type.IsGenericType && type.GetGenericTypeDefinition () == typeof (Nullable<>);
+ protected static bool IsUnsigned (Type t)
+ {
+ if (t.IsPointer)
+ return IsUnsigned (t.GetElementType ());
+ return t == typeof (ushort) || t == typeof (uint) || t == typeof (ulong) || t == typeof (byte);
+ }
//
// returns the T in a a Nullable<T> type.
@@ -28,6 +28,7 @@
using System;
using System.Reflection;
+using System.Reflection.Emit;
namespace System.Linq.Expressions {
@@ -75,6 +76,12 @@ namespace System.Linq.Expressions {
internal override void Emit (EmitContext ec)
+ var il = ec.ig;
+ operand.Emit (ec);
+ bool is_unsigned = IsUnsigned (operand.Type);
throw new NotImplementedException ();