@@ -80,20 +80,24 @@ protected override void HandleXmlElement(SyntaxNodeAnalysisContext context, XmlN
8080 private static void AnalyzeSummaryElement ( SyntaxNodeAnalysisContext context , XmlNodeSyntax syntax , Location diagnosticLocation , PropertyDeclarationSyntax propertyDeclaration , string startingTextGets , string startingTextSets , string startingTextGetsOrSets )
8181 {
8282 var diagnosticProperties = ImmutableDictionary . CreateBuilder < string , string > ( ) ;
83+ ArrowExpressionClauseSyntax expressionBody = propertyDeclaration . ExpressionBody ;
8384 AccessorDeclarationSyntax getter = null ;
8485 AccessorDeclarationSyntax setter = null ;
8586
86- foreach ( var accessor in propertyDeclaration . AccessorList . Accessors )
87+ if ( propertyDeclaration . AccessorList != null )
8788 {
88- switch ( accessor . Keyword . Kind ( ) )
89+ foreach ( var accessor in propertyDeclaration . AccessorList . Accessors )
8990 {
90- case SyntaxKind . GetKeyword :
91- getter = accessor ;
92- break ;
91+ switch ( accessor . Keyword . Kind ( ) )
92+ {
93+ case SyntaxKind . GetKeyword :
94+ getter = accessor ;
95+ break ;
9396
94- case SyntaxKind . SetKeyword :
95- setter = accessor ;
96- break ;
97+ case SyntaxKind . SetKeyword :
98+ setter = accessor ;
99+ break ;
100+ }
97101 }
98102 }
99103
@@ -107,12 +111,13 @@ private static void AnalyzeSummaryElement(SyntaxNodeAnalysisContext context, Xml
107111 var textElement = summaryElement . Content . FirstOrDefault ( ) as XmlTextSyntax ;
108112 var text = textElement == null ? string . Empty : XmlCommentHelper . GetText ( textElement , true ) . TrimStart ( ) ;
109113
110- if ( getter != null )
114+ if ( getter != null || expressionBody != null )
111115 {
112116 bool startsWithGetOrSet = text . StartsWith ( startingTextGetsOrSets , StringComparison . Ordinal ) ;
113117
114118 if ( setter != null )
115119 {
120+ // There is no way getter is null (can't have expression body and accessor list)
116121 var getterAccessibility = getter . GetEffectiveAccessibility ( context . SemanticModel , context . CancellationToken ) ;
117122 var setterAccessibility = setter . GetEffectiveAccessibility ( context . SemanticModel , context . CancellationToken ) ;
118123 bool getterVisible ;
0 commit comments