dotnet / roslynator

Roslynator is a set of code analysis tools for C#, powered by Roslyn.

Home Page:https://josefpihrt.github.io/docs/roslynator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RCS1246 suggestion for Last() is not usable in .NET Framework 4.8

KavenBreton-eaton opened this issue · comments

Product and Version Used: Roslynator 4.12.1 and .NET Framework 4.8

Steps to Reproduce:
Use the Last() method of a List object for instance.

Actual Behavior:
Suggestion is to use [^1] but this is not usable in .NET Framework 4.8. We did not want to suppress the issue since other suggestions are of use for us.

Expected Behavior:
Having either a suggestion for .NET Framework 4.8 or don't raise it for this version.

Possible solution is to check if System.Index exists.