Priority
Show-stopper
Type
Bug 
State
Fixed 
Assignee
Oleg Stepanov 
Subsystem
No subsystem 
Affected versions
Fixed in
Fixed in build
Next build 
Build
468
Fixed in build
469
  • Submitted by   David Gardiner
    2 years ago (27 Jun 2007 06:43)
  • Updated by David Gardiner
    2 years ago (27 Jun 2007 13:56)
  • Jira: RSRP-44298
    (history, comments)

RSRP-44298

"Iterate generic IList" VB live template contains incorrect code

0
The template code uses .Count for the upper bound of the for loop.

eg.
For $INDEX$ As Integer = 0 To $LIST$.Count
Dim $ELEM$ As $TYPE$ = $LIST$($INDEX$)
$END$
Next

This is incorrect - it should use .Count -1

eg. the following code used the template, and throws an ArgumentOutOfRangeException

Dim list As New List(Of String)

list.Add("fred")

For i As Integer = 0 To list.Count
Dim s As String = list(i)

Next

Issue was closed
Comments (0)
 
History (0)
 
Links
 
Issue has no comments