34 lines
1.2 KiB
C#
34 lines
1.2 KiB
C#
using System.Diagnostics;
|
|||
|
|
using Microsoft.CodeAnalysis.CSharp.Symbols;
|
||
|
|
|
||
|
|
namespace Microsoft.CodeAnalysis.CSharp;
|
||
|
|
|
||
|
|
internal sealed class OutVariablePendingInference : VariablePendingInference
|
||
|
|
{
|
||
|
|
public override object Display => string.Empty;
|
||
|
|
|
||
|
|
protected override ErrorCode InferenceFailedError => ErrorCode.ERR_TypeInferenceFailedForImplicitlyTypedOutVariable;
|
||
|
|
|
||
|
|
public OutVariablePendingInference(SyntaxNode syntax, Symbol variableSymbol, BoundExpression? receiverOpt, bool hasErrors = false)
|
||
|
|
: base(BoundKind.OutVariablePendingInference, syntax, variableSymbol, receiverOpt, hasErrors || receiverOpt.HasErrors())
|
||
|
|
{
|
||
|
|
}
|
||
|
|
|
||
|
|
[DebuggerStepThrough]
|
||
|
|
public override BoundNode? Accept(BoundTreeVisitor visitor)
|
||
|
|
{
|
||
|
|
return visitor.VisitOutVariablePendingInference(this);
|
||
|
|
}
|
||
|
|
|
||
|
|
public OutVariablePendingInference Update(Symbol variableSymbol, BoundExpression? receiverOpt)
|
||
|
|
{
|
||
|
|
if (!SymbolEqualityComparer.ConsiderEverything.Equals(variableSymbol, base.VariableSymbol) || receiverOpt != base.ReceiverOpt)
|
||
|
|
{
|
||
|
|
OutVariablePendingInference outVariablePendingInference = new OutVariablePendingInference(Syntax, variableSymbol, receiverOpt, base.HasErrors);
|
||
|
|
outVariablePendingInference.CopyAttributes(this);
|
||
|
|
return outVariablePendingInference;
|
||
|
|
}
|
||
|
|
return this;
|
||
|
|
}
|
||
|
|
}
|