File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -655,7 +655,7 @@ public override async Task<CSharpSyntaxNode> VisitMethodBlock(VBSyntax.MethodBlo
655655 var methodBlock = await node . SubOrFunctionStatement . AcceptAsync < BaseMethodDeclarationSyntax > ( TriviaConvertingDeclarationVisitor , SourceTriviaMapKind . SubNodesOnly ) ;
656656
657657 var declaredSymbol = ModelExtensions . GetDeclaredSymbol ( _semanticModel , node ) ;
658- if ( ! declaredSymbol . CanHaveMethodBody ( ) ) {
658+ if ( declaredSymbol ? . CanHaveMethodBody ( ) == false ) {
659659 return methodBlock ;
660660 }
661661 var csReturnVariableOrNull = CommonConversions . GetRetVariableNameOrNull ( node ) ;
@@ -786,7 +786,8 @@ public override async Task<CSharpSyntaxNode> VisitMethodStatement(VBSyntax.Metho
786786 null
787787 ) ;
788788
789- return hasBody && declaredSymbol . CanHaveMethodBody ( ) ? decl : decl . WithSemicolonToken ( SemicolonToken ) ;
789+ bool canHaveMethodBody = declaredSymbol ? . CanHaveMethodBody ( ) != false ;
790+ return hasBody && canHaveMethodBody ? decl : decl . WithSemicolonToken ( SemicolonToken ) ;
790791 }
791792
792793 public override async Task < CSharpSyntaxNode > VisitEventBlock ( VBSyntax . EventBlockSyntax node )
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ public static bool IsPartialMethodImplementation(this ISymbol declaredSymbol)
7575
7676 public static bool CanHaveMethodBody ( this ISymbol declaredSymbol )
7777 {
78- return ! ( declaredSymbol is IMethodSymbol ms ) || ( ! ms . IsPartialDefinition && ( ms . PartialImplementationPart == null && ! ms . IsExtern ) ) ;
78+ return declaredSymbol is IMethodSymbol ms && ( ! ms . IsPartialDefinition && ( ms . PartialImplementationPart == null && ! ms . IsExtern ) ) ;
7979 }
8080
8181 public static bool IsPartialMethodDefinition ( this ISymbol declaredSymbol )
You can’t perform that action at this time.
0 commit comments