(DISTFILES): Comment out a few missing files.
[mono-project.git] / mcs / btests / ConversionsA.vb
blobcaa7927e78e958aced7408f492a62549daf4e785
2 Imports System
3 Imports Microsoft.VisualBasic
5 Module ConversionsA
7 Sub f1(ByRef a As Object)
8 End Sub
10 Sub f2(ByVal array() As Object, ByVal index As Integer, ByVal count As Integer, ByVal value As Object)
11 Dim i As Integer
12 For i = index To (index + count) - 1
13 array(i) = value
14 Next i
15 End Sub
18 Sub Main()
19 On Error GoTo ErrorHandler
21 Dim a(10) As Object
22 Dim b() As Object = New String(10) {}
23 f1(a(0))
24 f1(b(1)) ' ArrayTypeMismatchException
26 Dim str(100) As String
27 f2(str, 0, 101, "Undefined")
28 f2(str, 0, 10, Nothing)
29 f2(str, 91, 10, 0) ' ArrayTypeMismatchException
30 Exit Sub
32 ErrorHandler:
33 If Err.Number <> 5 Then ' System.ArrayTypeMismatchException
34 Throw New Exception("#CA1 - Conversion Statement failed")
35 End If
36 Resume Next
38 End Sub
40 End Module