2004-11-09 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / btests / Function_ParamArrayC2.vb
1 REM LineNo: 13
2 REM ExpectedError: BC30667
3 REM ErrorMessage: ParamArray parameters must be declared 'ByVal'.
4
5 '=============================================================================================
6 'Name:Manish Kumar Sinha 
7 'Email Address: manishkumarsinha@sify.com
8 'Test Case Name: Param Array:
9 'APR-1.1.1:If ParamArray modifier is precied by ByRef modifier the it produces compiler error 
10 '=============================================================================================
11 Imports System
12 Module PA_1_1_1
13    Function F(ParamArray ByRef args() As Integer) As Integer()
14       Dim i As Integer
15       For Each i In args
16          Console.Write(" " & i)
17       Next i
18       Console.WriteLine()
19    End Function
20    Sub Main()
21       Dim a As Integer() = { 1, 2, 3 }
22
23       F(a)
24       F(10, 20, 30, 40)
25       F()
26    End Sub
27 End Module
28 '================================================================================