Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/linker.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Gocke <angocke@microsoft.com>2022-07-20 18:40:43 +0300
committerGitHub <noreply@github.com>2022-07-20 18:40:43 +0300
commit7a61266453f937bad25af292b602dc5348ff18c4 (patch)
tree81dd0a92a903d09d2887ee8363d087025d6510ce /src/ILLink.CodeFix/RequiresAssemblyFilesCodeFixProvider.cs
parent60f48c55b5e0183bd1cee4cfa14f1d9ad3d90935 (diff)
Fix syntax node scope and nullable warnings (#2900)
The syntax node scope should be the innermost node, otherwise GetSymbolInfo will often return null. As an example, GetSymbolInfo will return null for an ArgumentSyntax node, but the underlying expression will likely resolve into a symbol. Also adds proper null checks in case any of the providers return null.
Diffstat (limited to 'src/ILLink.CodeFix/RequiresAssemblyFilesCodeFixProvider.cs')
-rw-r--r--src/ILLink.CodeFix/RequiresAssemblyFilesCodeFixProvider.cs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ILLink.CodeFix/RequiresAssemblyFilesCodeFixProvider.cs b/src/ILLink.CodeFix/RequiresAssemblyFilesCodeFixProvider.cs
index ea734e746..1bf420c05 100644
--- a/src/ILLink.CodeFix/RequiresAssemblyFilesCodeFixProvider.cs
+++ b/src/ILLink.CodeFix/RequiresAssemblyFilesCodeFixProvider.cs
@@ -33,7 +33,7 @@ namespace ILLink.CodeFix
public sealed override Task RegisterCodeFixesAsync (CodeFixContext context) => BaseRegisterCodeFixesAsync (context);
- protected override SyntaxNode[] GetAttributeArguments (ISymbol attributableSymbol, ISymbol targetSymbol, SyntaxGenerator syntaxGenerator, Diagnostic diagnostic)
+ protected override SyntaxNode[] GetAttributeArguments (ISymbol? attributableSymbol, ISymbol targetSymbol, SyntaxGenerator syntaxGenerator, Diagnostic diagnostic)
{
var symbolDisplayName = targetSymbol.GetDisplayName ();
if (string.IsNullOrEmpty (symbolDisplayName) || HasPublicAccessibility (attributableSymbol))