2009-10-20 Jb Evain <jbevain@novell.com>
[mcs.git] / tests / test-184.cs
blobd925d951ca1d0232281be4a5bc887424fd5b414a
1 //
2 // This bug exposes a problem when calling a struct constructor that is
3 // initialized from an instance constructor
4 //
5 using System;
6 public interface Interface
8 int X{ get; }
11 public struct Struct : Interface
13 public Struct( int x ) { }
14 public int X { get { return 0; } }
17 public class User
19 public User( Interface iface ) { }
21 public class Test
23 User t;
24 Test() { t=new User (new Struct(5)); }
27 // This one was not handled before by the compiler
28 // constrast that to the use on the constructor above, that
29 // worked just fine
31 User t2=new User(new Struct(251));
33 static int Main ()
35 Test tt = new Test ();
37 return 0;