@@ -48,7 +48,8 @@ private static void HandlePostfixUnaryExpression(SyntaxNodeAnalysisContext conte
4848 if ( ! context . IsExcludedFromAnalysis ( ) &&
4949 ! IsInIgnoredScope ( context ) &&
5050 context . Node is PostfixUnaryExpressionSyntax { Operand : { } operand } postfix &&
51- AssignedExpression ( context . ContainingSymbol . ContainingType , operand ) is { } backing )
51+ context is { ContainingSymbol : { ContainingType : { } containingType } } &&
52+ AssignedExpression ( containingType , operand ) is { } backing )
5253 {
5354 Handle ( postfix , backing , context ) ;
5455 }
@@ -59,7 +60,8 @@ private static void HandlePrefixUnaryExpression(SyntaxNodeAnalysisContext contex
5960 if ( ! context . IsExcludedFromAnalysis ( ) &&
6061 ! IsInIgnoredScope ( context ) &&
6162 context . Node is PrefixUnaryExpressionSyntax { Operand : { } operand } prefix &&
62- AssignedExpression ( context . ContainingSymbol . ContainingType , operand ) is { } backing )
63+ context is { ContainingSymbol : { ContainingType : { } containingType } } &&
64+ AssignedExpression ( containingType , operand ) is { } backing )
6365 {
6466 Handle ( prefix , backing , context ) ;
6567 }
@@ -70,7 +72,8 @@ private static void HandleAssignmentExpression(SyntaxNodeAnalysisContext context
7072 if ( ! context . IsExcludedFromAnalysis ( ) &&
7173 ! IsInIgnoredScope ( context ) &&
7274 context . Node is AssignmentExpressionSyntax { Left : { } left } assignment &&
73- AssignedExpression ( context . ContainingSymbol . ContainingType , left ) is { } backing )
75+ context is { ContainingSymbol : { ContainingType : { } containingType } } &&
76+ AssignedExpression ( containingType , left ) is { } backing )
7477 {
7578 Handle ( assignment , backing , context ) ;
7679 }
@@ -82,15 +85,16 @@ private static void HandleArgument(SyntaxNodeAnalysisContext context)
8285 ! IsInIgnoredScope ( context ) &&
8386 context . Node is ArgumentSyntax { Expression : { } expression } argument &&
8487 argument . RefOrOutKeyword . IsKind ( SyntaxKind . RefKeyword ) &&
85- AssignedExpression ( context . ContainingSymbol . ContainingType , expression ) is { } backing )
88+ context is { ContainingSymbol : { ContainingType : { } containingType } } &&
89+ AssignedExpression ( containingType , expression ) is { } backing )
8690 {
8791 Handle ( argument . Expression , backing , context ) ;
8892 }
8993 }
9094
9195 private static void Handle ( ExpressionSyntax mutation , ExpressionSyntax backing , SyntaxNodeAnalysisContext context )
9296 {
93- if ( context . ContainingSymbol . ContainingType is { } containingType &&
97+ if ( context is { ContainingSymbol : { ContainingType : { } containingType } } &&
9498 containingType . IsAssignableTo ( KnownSymbol . INotifyPropertyChanged , context . Compilation ) &&
9599 mutation . TryFirstAncestorOrSelf < TypeDeclarationSyntax > ( out var typeDeclaration ) )
96100 {
0 commit comments