Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDE0057 incorrectly handles substrings on String itself #38055

Closed
stephentoub opened this issue Aug 16, 2019 · 1 comment · Fixed by #48321
Closed

IDE0057 incorrectly handles substrings on String itself #38055

stephentoub opened this issue Aug 16, 2019 · 1 comment · Fixed by #48321
Labels
Area-IDE Bug help wanted The issue is "up for grabs" - add a comment if you are interested in working on it IDE-CodeStyle Built-in analyzers, fixes, and refactorings New Language Feature - Range Range Pedantic ;)
Milestone

Comments

@stephentoub
Copy link
Member

Version Used:
3.3.0-beta3-19413-06+ac06df1bffb7b7fd0e5bf63cc91921af76b21e03

Steps to Reproduce:
This is a super corner-case only relevant to a few people in the world, so I'll understand if you want to close it. Just opening the issue in case.

The definition of System.String itself uses its own Substring in a few places, e.g.

splitStrings[arrIndex++] = Substring(currIndex, sepList[i] - currIndex);

IDE0057 fires here, and transforms it into:

splitStrings[arrIndex++] = Substring[currIndex..sepList[i]];

which doesn't compile. It should have been transformed instead into:

splitStrings[arrIndex++] = this[currIndex..sepList[i]];

which works fine.

@sharwell sharwell added Bug help wanted The issue is "up for grabs" - add a comment if you are interested in working on it IDE-CodeStyle Built-in analyzers, fixes, and refactorings New Language Feature - Range Range Pedantic ;) labels Aug 17, 2019
@sharwell sharwell added this to the Backlog milestone Aug 17, 2019
@CyrusNajmabadi
Copy link
Member

i definitely did not consider this case :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Bug help wanted The issue is "up for grabs" - add a comment if you are interested in working on it IDE-CodeStyle Built-in analyzers, fixes, and refactorings New Language Feature - Range Range Pedantic ;)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants