Copied remotely
[mono.git] / mcs / mbas / Test / errors / ShadowsB.vb
1 REM LineNo: 30
2 REM ExpectedError: BC40004
3 REM ErrorMessage: function 'F' conflicts with function 'F' in the base class 'B' and so should be declared 'Shadows'.
4
5 ' As per MS VB Specification (section 4.3.3)
6 ' this program should compile.
7 ' But MS VB compiler 7.0 is unable to compile it.
8 ' Still I am keeping this in positive test cases
9 ' May move it later to negative tests section 
10 ' after clarifying it with later versions of MS VB compilers.
11
12 ' In derived class if you 
13 ' override a method whithout
14 ' shadowing or overloading should get shadowed 
15 ' in the derived class by default
16 ' But it should throw an warning during compilation
17
18
19 Class B
20     Function F()
21     End Function
22
23     Function F(ByVal i As Integer)
24     End Function
25 End Class
26
27 Class D
28     Inherits B
29
30     Function F()
31     End Function
32 End Class
33
34 Module ShadowsB
35     Sub Main()
36     End Sub
37
38 End Module