Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

43 lines
668 B
C#

//
// This bug exposes a problem when calling a struct constructor that is
// initialized from an instance constructor
//
using System;
public interface Interface
{
int X{ get; }
}
public struct Struct : Interface
{
public Struct( int x ) { }
public int X { get { return 0; } }
}
public class User
{
public User( Interface iface ) { }
}
public class Test
{
User t;
Test() { t=new User (new Struct(5)); }
//
// This one was not handled before by the compiler
// constrast that to the use on the constructor above, that
// worked just fine
//
User t2=new User(new Struct(251));
public static int Main ()
{
Test tt = new Test ();
return 0;
}
}