Skip to content

Commit ae72239

Browse files
committed
Use GetProperty.Match
1 parent edb1236 commit ae72239

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

ReflectionAnalyzers/Helpers/Reflection/PropertyInfo.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
namespace ReflectionAnalyzers
22
{
33
using System.Threading;
4+
45
using Gu.Roslyn.AnalyzerExtensions;
6+
57
using Microsoft.CodeAnalysis;
68
using Microsoft.CodeAnalysis.CSharp;
79
using Microsoft.CodeAnalysis.CSharp.Syntax;
@@ -22,10 +24,8 @@ internal PropertyInfo(INamedTypeSymbol reflectedType, IPropertySymbol property)
2224
switch (expression)
2325
{
2426
case InvocationExpressionSyntax invocation
25-
when GetX.TryMatchGetProperty(invocation, semanticModel, cancellationToken, out var member, out _, out _, out _) &&
26-
member.ReflectedType is { } &&
27-
member.Symbol is IPropertySymbol property:
28-
return new PropertyInfo(member.ReflectedType, property);
27+
when GetProperty.Match(invocation, semanticModel, cancellationToken) is { Member: { ReflectedType: { } reflectedType, Symbol: IPropertySymbol property } }:
28+
return new PropertyInfo(reflectedType, property);
2929
}
3030

3131
if (expression.IsEither(SyntaxKind.IdentifierName, SyntaxKind.SimpleMemberAccessExpression) &&

0 commit comments

Comments
 (0)