**** Merged from MCS ****
[mono-project.git] / mcs / btests / ForEachC2.vb
blobaccfee3f522162a3b377ed1ab1df81e8daad2ed3
1 REM LineNo: 22
2 REM ExpectedError: BC30039
3 REM ErrorMessage: Loop control variable cannot be a property or a late-bound indexed array.
5 Imports System
7 Module ForEachC2
9 Private index As Integer = 0
10 Public Property myindex() As Integer
11 Get
12 Return index
13 End Get
14 Set(ByVal Value As Integer)
15 index = Value
16 End Set
17 End Property
19 Sub main()
20 Dim arr() As Integer = {1, 2, 3}
22 For Each myindex In arr
23 Console.WriteLine(myindex)
24 Next
26 End Sub
28 End Module