Last active
August 29, 2015 14:17
-
-
Save emoacht/336edbd7550deece18b3 to your computer and use it in GitHub Desktop.
Possible Resharper's bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Sub TestResharper1() | |
Dim source As String = "0123456789" | |
Dim lengths = New Integer() {4}.ToList() | |
lengths.ForEach( | |
Sub(x) | |
source = source.Substring(0, x) 'Resharper warning: Value assigned is not used in any execution path | |
End Sub) | |
Debug.WriteLine(source) '0123 | |
End Sub | |
Public Sub TestResharper2() | |
Dim source As String = "0123456789" | |
Dim lengths = New Integer() {4}.ToList() | |
lengths.ForEach( | |
Sub(x) source = source.Substring(0, x)) 'No Resharper warning | |
Debug.WriteLine(source) '0123 | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment