未验证 提交 37ccee67 编写于 作者: R Rikki Gibson 提交者: GitHub

Merge pull request #40833 from 333fred/annotate-binder

Annotate Binder.cs and BuckStopsHereBinder
......@@ -90,7 +90,7 @@ protected bool InCrefButNotParameterOrReturnType
/// </summary>
protected virtual bool IsUnboundTypeAllowed(GenericNameSyntax syntax)
{
return _next.IsUnboundTypeAllowed(syntax);
return Next.IsUnboundTypeAllowed(syntax);
}
/// <summary>
......
......@@ -29,7 +29,7 @@ internal partial class Binder
/// </remarks>
internal virtual ImmutableHashSet<Symbol> LockedOrDisposedVariables
{
get { return _next.LockedOrDisposedVariables; }
get { return Next.LockedOrDisposedVariables; }
}
/// <remarks>
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#nullable enable
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Roslyn.Utilities;
......@@ -12,14 +12,14 @@ namespace Microsoft.CodeAnalysis.CSharp
/// <summary>
/// A binder that knows no symbols and will not delegate further.
/// </summary>
internal partial class BuckStopsHereBinder : Binder
internal class BuckStopsHereBinder : Binder
{
internal BuckStopsHereBinder(CSharpCompilation compilation)
: base(compilation)
{
}
internal override ImportChain ImportChain
internal override ImportChain? ImportChain
{
get
{
......@@ -44,12 +44,12 @@ internal override Imports GetImports(ConsList<TypeSymbol> basesBeingResolved)
return Imports.Empty;
}
protected override SourceLocalSymbol LookupLocal(SyntaxToken nameToken)
protected override SourceLocalSymbol? LookupLocal(SyntaxToken nameToken)
{
return null;
}
protected override LocalFunctionSymbol LookupLocalFunction(SyntaxToken nameToken)
protected override LocalFunctionSymbol? LookupLocalFunction(SyntaxToken nameToken)
{
return null;
}
......@@ -80,7 +80,7 @@ internal override ConsList<FieldSymbol> FieldsBeingBound
}
}
internal override LocalSymbol LocalInProgress
internal override LocalSymbol? LocalInProgress
{
get
{
......@@ -117,7 +117,7 @@ internal override bool IsIndirectlyInIterator
}
}
internal override GeneratedLabelSymbol BreakLabel
internal override GeneratedLabelSymbol? BreakLabel
{
get
{
......@@ -125,7 +125,7 @@ internal override GeneratedLabelSymbol BreakLabel
}
}
internal override GeneratedLabelSymbol ContinueLabel
internal override GeneratedLabelSymbol? ContinueLabel
{
get
{
......@@ -133,7 +133,7 @@ internal override GeneratedLabelSymbol ContinueLabel
}
}
internal override BoundExpression ConditionalReceiverExpression
internal override BoundExpression? ConditionalReceiverExpression
{
get
{
......@@ -149,7 +149,7 @@ internal override TypeWithAnnotations GetIteratorElementType()
throw ExceptionUtilities.Unreachable;
}
internal override Symbol ContainingMemberOrLambda
internal override Symbol? ContainingMemberOrLambda
{
get
{
......@@ -174,7 +174,7 @@ internal override bool AreNullableAnnotationsGloballyEnabled()
}
}
internal override Binder GetBinder(SyntaxNode node)
internal override Binder? GetBinder(SyntaxNode node)
{
return null;
}
......
......@@ -235,7 +235,7 @@ public override Accessibility DeclaredAccessibility
/// return that as the "containing" symbol, even though the alias isn't a member of the
/// namespace as such.
/// </summary>
public override Symbol ContainingSymbol
public override Symbol? ContainingSymbol
{
get
{
......
......@@ -250,7 +250,7 @@ private static NamedTypeSymbol ConstructTupleUnderlyingType(NamedTypeSymbol firs
return currentSymbol;
}
private static void ReportUseSiteAndObsoleteDiagnostics(CSharpSyntaxNode? syntax, DiagnosticBag? diagnostics, NamedTypeSymbol firstTupleType)
private static void ReportUseSiteAndObsoleteDiagnostics(CSharpSyntaxNode? syntax, DiagnosticBag diagnostics, NamedTypeSymbol firstTupleType)
{
Binder.ReportUseSiteDiagnostics(firstTupleType, diagnostics, syntax);
Binder.ReportDiagnosticsIfObsoleteInternal(diagnostics, firstTupleType, syntax, firstTupleType.ContainingType, BinderFlags.None);
......@@ -259,7 +259,7 @@ private static void ReportUseSiteAndObsoleteDiagnostics(CSharpSyntaxNode? syntax
/// <summary>
/// For tuples with no natural type, we still need to verify that an underlying type of proper arity exists, and report if otherwise.
/// </summary>
internal static void VerifyTupleTypePresent(int cardinality, CSharpSyntaxNode? syntax, CSharpCompilation compilation, DiagnosticBag? diagnostics)
internal static void VerifyTupleTypePresent(int cardinality, CSharpSyntaxNode? syntax, CSharpCompilation compilation, DiagnosticBag diagnostics)
{
Debug.Assert(diagnostics is object && syntax is object);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册