Skip to content

Commit

Permalink
CR edit
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubreznak committed Apr 7, 2024
1 parent a636dbd commit 081a763
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Update - add Last [RCS1246](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1246) ([PR](https://github.com/dotnet/roslynator/pull/1431))
- Update - add Last [RCS1246](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1246) ([PR](https://github.com/dotnet/roslynator/pull/1436))

## [4.12.0] - 2024-03-19

Expand Down
1 change: 1 addition & 0 deletions src/Analyzers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7277,6 +7277,7 @@ public class C
<Title>Use element access</Title>
<DefaultSeverity>Info</DefaultSeverity>
<IsEnabledByDefault>true</IsEnabledByDefault>
<MinLanguageVersion>8.0 for [^1]</MinLanguageVersion>
<Samples>
<Sample>
<Before><![CDATA[list.First()]]></Before>
Expand Down
3 changes: 3 additions & 0 deletions src/Common/CSharp/Analysis/UseElementAccessAnalysis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ internal static class UseElementAccessAnalysis
if (invocationInfo.InvocationExpression.IsParentKind(SyntaxKind.ExpressionStatement))
return false;

if (((CSharpCompilation)semanticModel.Compilation).LanguageVersion < LanguageVersion.CSharp8)
return false;

IMethodSymbol methodSymbol = semanticModel.GetReducedExtensionMethodInfo(invocationInfo.InvocationExpression, cancellationToken).Symbol;

if (methodSymbol is null)
Expand Down

0 comments on commit 081a763

Please sign in to comment.