Welcome to mirror list, hosted at ThFree Co, Russian Federation.

test-184.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0888f1e2ac4d1fa6eca20fa0d84a93925f97eda3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//
// 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;
	}
}