summaryrefslogtreecommitdiff
path: root/mcs/tests/dtest-038.cs
blob: e6f747bde8bd18de6d3443725522be6f186b1b21 (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
using System;
using Microsoft.CSharp.RuntimeBinder;

public class Test
{
	void Foo ()
	{
	}
	
	public static int Main ()
	{
		dynamic d = new Test ();

		var t1 = true ? d : 2;
		t1.Foo ();
		
		var t2 = true ? 1 : d;
		if (t2 != 1)
			return 1;
		
		try {
			t2.Foo ();
			return 2;
		} catch (RuntimeBinderException) {
		}

		return 0;
	}
}