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

test-31.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7ede0c338a45e76e67d60f36aeebf901c8d1fb47 (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
35
36
37
38
39
40
41
//
// Versioning test: make sure that we output a warning, but still call the derived
// method
//
using System;

class Base {
	public int which;
	
	public virtual void A ()
	{
		which = 1;
	}
}

class Derived :Base {
	public virtual void A ()
	{
		which = 2;
	}
}

class Test {
	public static int Main ()
	{
		Derived d = new Derived ();

		//
		// This should call Derived.A and output a warning.
		//
		d.A ();

		
		if (d.which == 1)
			return 1;

		Console.WriteLine ("Test passes");
		
		return 0;
	}
}