History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: RSRP-44298
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Oleg Stepanov
Reporter: David Gardiner
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
ReSharper

"Iterate generic IList" VB live template contains incorrect code

Created: 30 May 08 18:33   Updated: 27 Jun 07 13:56
Component/s: None
Fix Version/s: 3.0.1, 3.0.2
Security Level: Everybody (All jira users)

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Build: 468
Fixed in build: 469


 Description  « Hide
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

Next



 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.