2004-11-07 Ben Maurer <bmaurer@ximian.com>
[mono-project.git] / mcs / btests / SyncLockC2.vb
blob49d7718fc9606a00c32baf68d0fce6742d07faa2
1 REM LineNo: 14
2 REM ExpectedError: BC30752
3 REM ErrorMessage: 'On Error' statements are not valid within 'SyncLock' statements.
5 Imports System
7 Module SyncLockC2
9 Class C
11 Sub f4()
12 Dim i As Integer = 0
13 SyncLock GetType(C)
14 On Error GoTo ErrorHandler
15 i = 5 / i
16 End SyncLock
17 Exit Sub
18 ErrorHandler:
19 i = 5
20 Resume ' Execution resumes with the statement that caused the error
21 End Sub
23 End Class
25 Sub Main()
26 Dim c As New C()
27 c.f4()
28 End Sub
30 End Module