In gmcs:
[mono.git] / mcs / mcs / literal.cs
index 6d3a4ceeac0c7a19c6e910c9e912c7bea0df4326..c7aae9204b0a775c51648643e8ade9d926fb42ca 100644 (file)
@@ -100,7 +100,7 @@ namespace Mono.CSharp {
                        return "null";
                }
 
-               public override void Error_ValueCannotBeConverted (Location loc, Type t)
+               public override void Error_ValueCannotBeConverted (Location loc, Type t, bool expl)
                {
                        Report.Error (37, loc, "Cannot convert null to `{0}' because it is a value type",
                                TypeManager.CSharpName (t));
@@ -114,6 +114,13 @@ namespace Mono.CSharp {
                        return base.ToType (type, loc);
                }
 
+               public override Constant Reduce(EmitContext ec, Type target_type)
+               {
+                       if (!TypeManager.IsValueType (target_type))
+                               return new NullCast (this, target_type);
+
+                       return null;
+               }
        }
 
        //