2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / mbas / Test / errors / 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    Sub F(ParamArray ByRef args() As Integer)
14         Dim a as Integer
15         a = args.Length
16         if a=0
17                 Throw New System.Exception("#A1, Unexcepted behavoiur of PARAM ARRAY")
18         end if
19
20    End Sub
21    Sub Main()
22       Dim a As Integer() = { 1, 2, 3 }
23       F(a)
24       F(10, 20, 30, 40)
25    End Sub
26 End Module
27 '================================================================================