(DISTFILES): Comment out a few missing files.
[mono-project.git] / mcs / btests / ConstructorB.vb
blobda15c0f5659acd3419fbb07041f4274f1b79424a
1 Imports System
3 Class A
4 public Sub New()
5 End Sub
7 public Sub New(name as String)
8 if name <> "abc" then
9 throw new exception ("#A1, Unexpected result")
10 end if
11 End Sub
12 End Class
14 Class B
15 Inherits A
17 ' call base class ctor explicitly
18 public Sub New()
19 MyBase.New()
20 End Sub
21 End Class
23 Class C
24 Inherits A
26 ' call base class ctor with parameter
27 public Sub New()
28 MyBase.NEw("abc")
29 End Sub
30 End Class
32 Class D
34 ' call another ctor in the same class
35 ' either of the methods mentioned below should give same result
36 public Sub New()
37 MyClass.NEw("aaa")
38 'Me.NEw("aaa")
39 End Sub
41 public Sub New(name as String)
42 if name <> "aaa" then
43 throw new exception ("#A2, Unexpected result")
44 end if
45 End Sub
46 End Class
48 Module M
49 Sub Main()
50 dim x as B = new B()
51 dim y as C = new C()
52 dim z as D = new D()
53 End Sub
54 End Module