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

ExpressionCallStringAndLocals.cs « Reflection « Mono.Linker.Tests.Cases « test - github.com/mono/linker.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ef1ed769570d6acf68c62b3b1c42a19c9fc6a7cc (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
using System;
using System.Linq.Expressions;
using Mono.Linker.Tests.Cases.Expectations.Assertions;
using Mono.Linker.Tests.Cases.Expectations.Metadata;

namespace Mono.Linker.Tests.Cases.Reflection
{
	[Reference ("System.Core.dll")]
	public class ExpressionCallStringAndLocals
	{
		public static void Main ()
		{
			Branch_SystemTypeValueNode_KnownStringValue ();
		}

		[Kept]
		private static int OnlyCalledViaExpression ()
		{
			return 42;
		}

		[Kept]
		static void Branch_SystemTypeValueNode_KnownStringValue ()
		{
			var t1 = typeof (ExpressionCallStringAndLocals);
			var t2 = t1;

			var expr = Expression.Call (t2, "OnlyCalledViaExpression", Type.EmptyTypes);
			Console.WriteLine (expr.Method);
		}
	}
}