Bug 19033

Summary: default parameter get System.Reflection.Missing instead of null when using library
Product: [Mono] Compilers Reporter: Lóránt Dobos <xamarin>
Component: C#Assignee: Marek Safar <masafa>
Status: RESOLVED FIXED    
Severity: normal CC: mono-bugs+mono
Priority: ---    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Tags: Is this bug a regression?: ---
Last known good build:

Description Lóránt Dobos 2014-04-14 10:33:47 UTC
bug2.cs:
using System;
public static class Program
{
    public static void Main()
    {
        Console.WriteLine("{0}", Lib.Foo<object>());
    }
}

bug2lib.cs:
using System;
public static class Lib
{
    public static T Foo<T>(T x = default(T))
    {
        return x;
    }
}

dmcs -t:library bug2lib.cs; dmcs bug2.cs -r:bug2lib.dll; ./bug2.exe

expected result is null but it prints System.Reflection.Missing.
It works if compiled together (dmcs bug2.cs bug2lib.cs)
Comment 1 Marek Safar 2014-05-06 11:57:53 UTC
Fixed in master