blob: c7c31fed25ee2bdf562807ef01d28704886b744e (
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 {
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;
}
}
|