提交 cbb0b3d6 编写于 作者: S Sam Harwell

Pass non-null arguments to avoid nullability warning

上级 6e03c8ba
......@@ -179,7 +179,7 @@ internal string GetDebuggerDisplay()
// construct the alias sym with the binder for which we are building imports. That
// way the alias target can make use of extern alias definitions.
usingAliases.Add(identifierValueText, new AliasAndUsingDirective(new AliasSymbol(usingsBinder, usingDirective), usingDirective));
usingAliases.Add(identifierValueText, new AliasAndUsingDirective(new AliasSymbol(usingsBinder, usingDirective.Name, usingDirective.Alias), usingDirective));
}
}
else
......
......@@ -1858,7 +1858,7 @@ public override ILabelSymbol GetDeclaredSymbol(SwitchLabelSyntax declarationSynt
else
{
// Case: multiple aliases, not the first (see DevDiv #9368)
return new AliasSymbol(binder, declarationSyntax).GetPublicSymbol();
return new AliasSymbol(binder, declarationSyntax.Name, declarationSyntax.Alias).GetPublicSymbol();
}
}
......
......@@ -75,12 +75,13 @@ private AliasSymbol(Binder binder, SyntaxToken aliasName)
_binder = binder;
}
internal AliasSymbol(Binder binder, UsingDirectiveSyntax syntax)
#nullable disable // Can 'syntax.Alias' be null here? https://github.com/dotnet/roslyn/issues/39166
: this(binder, syntax.Alias.Name.Identifier)
#nullable enable
internal AliasSymbol(Binder binder, NameSyntax name, NameEqualsSyntax alias)
: this(binder, alias.Name.Identifier)
{
_aliasTargetName = syntax.Name;
Debug.Assert(name.Parent.IsKind(SyntaxKind.UsingDirective));
Debug.Assert(name.Parent == alias.Parent);
_aliasTargetName = name;
}
internal AliasSymbol(Binder binder, ExternAliasDirectiveSyntax syntax)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册