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

LocalPassedAsParameterToGenericWithConstraint2.cs « NoKeptCtorButInterfaceNeeded « OnReferenceType « Inheritance.Interfaces « Mono.Linker.Tests.Cases « Tests « linker - github.com/mono/linker.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cecf742e4ec4956ddc7d27731dc41a8d2f720e81 (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 Mono.Linker.Tests.Cases.Expectations.Assertions;

namespace Mono.Linker.Tests.Cases.Inheritance.Interfaces.OnReferenceType.NoKeptCtorButInterfaceNeeded {
	public class LocalPassedAsParameterToGenericWithConstraint2 {
		public static void Main ()
		{
			Foo f = null;
			Foo2 f2 = null;
			Helper (f, f2);
		}

		[Kept]
		static void Helper<T> (T f, Foo2 arg2) where T : IFoo
		{
		}

		[Kept]
		[KeptInterface (typeof (IFoo))]
		class Foo : IFoo {
		}
		
		[Kept]
		[KeptInterface (typeof (IFoo))] // technically this can be removed, but it would require more complex knowledge of the stack to do so
		class Foo2 : IFoo {
		}


		[Kept]
		interface IFoo {
		}
	}
}