2009-02-16 Marek Safar <marek.safar@gmail.com>
[mono.git] / mcs / mcs / nullable.cs
index b862f58c228f4cdb265cf8be838f5786da906e84..c058e59db45a1a087aa33d1c5c4a1195d43b5f80 100644 (file)
@@ -136,22 +136,19 @@ namespace Mono.CSharp.Nullable
                public override void Emit (EmitContext ec)
                {
                        Store (ec);
-                       AddressOf (ec, AddressOp.LoadStore);
-                       ec.ig.EmitCall (OpCodes.Call, info.Value, null);
+                       Invocation.EmitCall (ec, false, this, info.Value, null, loc);
                }
 
                public void EmitCheck (EmitContext ec)
                {
                        Store (ec);
-                       AddressOf (ec, AddressOp.LoadStore);
-                       ec.ig.EmitCall (OpCodes.Call, info.HasValue, null);
+                       Invocation.EmitCall (ec, false, this, info.HasValue, null, loc);
                }
 
                public void EmitGetValueOrDefault (EmitContext ec)
                {
                        Store (ec);
-                       AddressOf (ec, AddressOp.LoadStore);
-                       ec.ig.EmitCall (OpCodes.Call, info.GetValueOrDefault, null);
+                       Invocation.EmitCall (ec, false, this, info.GetValueOrDefault, null, loc);
                }
 
                public override bool Equals (object obj)
@@ -626,13 +623,13 @@ namespace Mono.CSharp.Nullable
                        // Arguments can be lifted for equal operators when the return type is bool and both
                        // arguments are of same type
                        //      
-                       if (left is NullLiteral) {
+                       if (left_orig.IsNull) {
                                left = right;
                                left_null_lifted = true;
                                type = TypeManager.bool_type;
                        }
 
-                       if (right is NullLiteral) {
+                       if (right_orig.IsNull) {
                                right = left;
                                right_null_lifted = true;
                                type = TypeManager.bool_type;