**** Merged from MCS ****
[mono-project.git] / mcs / mbas / Test / tests / OverrideA.vb
blob5c8dcacb80f3ea3ad32a3faf99cdc0d86edbb785
1 Class B
2 Overridable Function F() As Integer
3 Return 5
4 End Function
5 End Class
7 Class D
8 Inherits B
10 Overrides Function F() As Integer
11 ' you should be able to access
12 ' the members of base class
13 ' using 'MyBase' as follows
14 MyBase.F()
16 Return 10
17 End Function
18 End Class
20 Module OverrideA
21 Sub Main()
22 Dim x As B
24 x = New B()
25 If x.F() <> 5 Then
26 Throw New System.Exception("#A1, unexpected result from base class")
27 End If
29 x = New D()
30 If x.F() <> 10 Then
31 Throw New System.Exception("#A2, unexpected result from derived class")
32 End If
33 End Sub
34 End Module