Some late bindig testcases
[mono.git] / mcs / mbas / Test / tests / latebinding / InheritanceA.vb
1 Imports System
2 Public Class C1
3         dim t1 as Type = GetType (C1)
4
5         Function f1 (name as string)
6                 If t1.name <> name Then
7                         Throw New System.Exception("#A1 Unexpected result")
8                 End If
9         End Function
10
11         Function f1 (name as string, t as type)
12                 If t.name <> name Then
13                         Throw New System.Exception("#A2 Unexpected result")
14                 End If
15         End Function
16
17         Function fn() As Integer
18                 Return 5
19         End Function
20 End Class
21
22 Public Class C2
23         Inherits C1
24         dim t as Type = GetType (C2)
25         
26         Function f2(name as string)
27                 f1(name, t)
28         End Function
29 End Class
30
31 Public Class C3
32         Inherits C2
33 End Class
34
35 Module Inheritance
36         Sub Main()
37                 Dim a As Integer
38                 Dim c1 As Object = New C1()
39                 a = c1.f1("C1")
40                 
41                 Dim c2 As Object = New C2()
42                 a = c2.f1("C1")
43                 a = c2.f2("C2")
44                 a = c2.fn()
45                 
46                 Dim c3 As Object = New c3()
47                 c3.f1("C1")
48                 c3.f2("C2")
49                 c3.fn()
50         End Sub
51 End Module