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

gtest-etree-18.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 091cc88b3637e5b8f46e523f398824157d82dc12 (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
using System;
using System.Linq.Expressions;

public class FooBase { }
public class Foo : FooBase { }

public interface IHelper
{
	void DoIt (FooBase foo);
}

public class Program
{
	public static int Main ()
	{
		Expression<Action<IHelper>> e = (helper => helper.DoIt (new Foo ()));
		var mce = e.Body as MethodCallExpression;
		var et = mce.Arguments[0].NodeType;

		Console.WriteLine (et);
		if (et != ExpressionType.New)
			return 1;

		return 0;
	}
}