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

OverrideWithAnotherVirtualMethodOfSameNameWithDifferentParameterType.cs « Generics « Mono.Linker.Tests.Cases « Tests « linker - github.com/mono/linker.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ba81282b81dff9b28f2c244070adcdd2193a0ecf (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
using Mono.Linker.Tests.Cases.Expectations.Assertions;

namespace Mono.Linker.Tests.Cases.Generics {
	class OverrideWithAnotherVirtualMethodOfSameNameWithDifferentParameterType {
		public static void Main (string [] args)
		{
			new Derived<double, int> ().Method (1.0);
		}

		[KeptMember (".ctor()")]
		public class Base<S> {
			[Kept]
			public virtual S Method (S arg)
			{
				return arg;
			}
		}

		[KeptMember (".ctor()")]
		[KeptBaseType (typeof (Base<>), "K")]
		public class Derived<K, S> : Base<K> {
			[Kept]
			public override K Method (K arg)
			{
				return arg;
			}

			public virtual S Method (S arg)
			{
				return arg;
			}
		}
	}
}