701 references to Kind
Microsoft.CodeAnalysis.CSharp (701)
Binder\Binder.cs (1)
873RoslynDebug.Assert(statement.Kind != BoundKind.StatementList);
Binder\Binder.ValueChecks.cs (30)
506switch (expr.Kind) 612if (expr.Kind == BoundKind.MethodGroup && valueKind != BindValueKind.RValueOrMethodGroup) 637if ((object)otherSymbol != null && receiver?.Kind == BoundKind.TypeOrValueExpression) 674switch (expression?.Kind) 677case BoundKind.QueryClause when ((BoundQueryClause)expression).Value.Kind == BoundKind.TypeOrValueExpression: 706switch (expr.Kind) 711case BoundKind.ImplicitIndexerAccess when ((BoundImplicitIndexerAccess)expr).IndexerOrSliceAccess.Kind == BoundKind.IndexerAccess: 732switch (expr.Kind) 896throw ExceptionUtilities.UnexpectedValue(implicitIndexer.IndexerOrSliceAccess.Kind); 969RoslynDebug.Assert(expr is not BoundValuePlaceholderBase, $"Placeholder kind {expr.Kind} should be explicitly handled"); 1014switch (expr.Kind) 1631return Flags.Includes(BinderFlags.ObjectInitializerMember) && receiver.Kind == BoundKind.ObjectOrCollectionValuePlaceholder || 1795ReportDiagnosticsIfObsolete(diagnostics, setMethod, node, receiver?.Kind == BoundKind.BaseReference); 1845ReportDiagnosticsIfObsolete(diagnostics, getMethod, node, receiver?.Kind == BoundKind.BaseReference); 1928if (receiverOpt?.Kind == BoundKind.BaseReference && member.IsAbstract) 2341if (argument.Kind == BoundKind.ArgListOperator) 3366switch (expr.Kind) 3546throw ExceptionUtilities.UnexpectedValue(implicitIndexerAccess.IndexerOrSliceAccess.Kind); 3681switch (expr.Kind) 3867throw ExceptionUtilities.UnexpectedValue(implicitIndexerAccess.IndexerOrSliceAccess.Kind); 4069switch (expr.Kind) 4242throw ExceptionUtilities.UnexpectedValue(implicitIndexerAccess.IndexerOrSliceAccess.Kind); 4532RoslynDebug.Assert(false, $"{expr.Kind} expression of {expr.Type} type"); 4619if (expr.Kind == BoundKind.AssignmentOperator) 4761switch (expr.Kind) 4975throw ExceptionUtilities.UnexpectedValue(implicitIndexerAccess.IndexerOrSliceAccess.Kind); 5327RoslynDebug.Assert(false, $"{expr.Kind} expression of {expr.Type} type"); 5657throw ExceptionUtilities.UnexpectedValue(expression.Kind); 5725switch (expression.Kind) 5931fieldAccess.ReceiverOpt.Kind == BoundKind.ThisReference;
Binder\Binder_Attributes.cs (2)
812switch (assignment.Left.Kind) 862switch (node.Kind)
Binder\Binder_Await.cs (4)
78if (expression.Kind != BoundKind.Call || 340if (getAwaiterCall.Kind != BoundKind.Call) 379if (qualified.Kind != BoundKind.PropertyAccess) 447if (getAwaiterGetResultCall.Kind != BoundKind.Call)
Binder\Binder_Conversions.cs (4)
138if (conversion.IsAnonymousFunction && source.Kind == BoundKind.UnboundLambda) 209if (source.Kind == BoundKind.UnconvertedSwitchExpression) 231if (source.Kind == BoundKind.UnconvertedCollectionExpression) 253if (source.Kind == BoundKind.UnconvertedConditionalOperator)
Binder\Binder_Deconstruct.cs (7)
212if (boundRHS.Kind == BoundKind.TupleLiteral) 369switch (expression.Kind) 383throw ExceptionUtilities.UnexpectedValue(expression.Kind); 488if (element.Kind == BoundKind.TupleLiteral) 597if (expression.Kind == BoundKind.DiscardExpression) 661if (memberAccess.Kind != BoundKind.MethodGroup) 792if (expression == null && checkedVariable.Kind != BoundKind.DiscardExpression)
Binder\Binder_Expressions.cs (40)
200BoundKind exprKind = expr.Kind; 254if (valueOrType.Kind == BoundKind.TypeExpression) 411Debug.Assert(expr.Kind is BoundKind.UnboundLambda or BoundKind.MethodGroup); 539if (expr.Kind == BoundKind.ArgListOperator) 581if (IsEarlyAttributeBinder && result.Kind == BoundKind.MethodGroup && (!IsInsideNameof || EnclosingNameofArgument != node)) 2724if (operand.Kind == BoundKind.UnboundLambda) 2771switch (operand.Kind) 3068switch (arg.Kind) 3526else if (argument.Kind == BoundKind.OutVariablePendingInference) 3530else if (argument.Kind == BoundKind.OutDeconstructVarPendingInference) 3534else if (argument.Kind == BoundKind.DiscardExpression && !argument.HasExpressionType()) 5376else if (argument.Kind == BoundKind.MethodGroup) 5813if (boundMember.Kind == BoundKind.PropertyGroup) 5855BoundKind boundMemberKind = boundMember.Kind; 6444if (addMethodInvocation.Kind == BoundKind.DynamicInvocation) 6455else if (addMethodInvocation.Kind == BoundKind.Call) 6484Debug.Assert(addMethodInvocation.Kind == BoundKind.BadExpression); 6961switch (classCreation.Kind) 6974throw ExceptionUtilities.UnexpectedValue(classCreation.Kind); 7448if (boundValue.Kind == BoundKind.Conversion) 7640if (boundLeft.Kind == BoundKind.UnboundLambda) 7685switch (boundLeft.Kind) 7717if (boundLeft.Kind == BoundKind.Literal && ((BoundLiteral)boundLeft).ConstantValueOpt == ConstantValue.Null) 7888switch (expr.Kind) 7945bool leftIsBaseReference = boundLeft.Kind == BoundKind.BaseReference; 8036if (boundLeft.HasAnyErrors && boundLeft.Kind != BoundKind.TypeOrValueExpression) 8058else if (boundLeft.Kind == BoundKind.TypeExpression || 8059boundLeft.Kind == BoundKind.BaseReference || 8275ReportDiagnosticsIfObsolete(diagnostics, symbol, node, hasBaseReceiver: left.Kind == BoundKind.BaseReference); 8678ReportDiagnosticsIfObsolete(diagnostics, propertySymbol, node, hasBaseReceiver: receiver?.Kind == BoundKind.BaseReference); 8781switch (receiver.Kind) 8979if (receiver.Kind == BoundKind.PropertyGroup) 9394if (index.Kind == BoundKind.OutVariablePendingInference) 9398else if (index.Kind == BoundKind.DiscardExpression && !index.HasExpressionType()) 9586LookupOptions lookupOptions = expr.Kind == BoundKind.BaseReference ? LookupOptions.UseBaseReferenceAccessibility : LookupOptions.Default; 9700BoundKind receiverKind = receiver.Kind; 9842ReportDiagnosticsIfObsolete(diagnostics, property, syntax, hasBaseReceiver: receiver != null && receiver.Kind == BoundKind.BaseReference); 9852if (!gotError && receiver != null && receiver.Kind == BoundKind.ThisReference && receiver.WasCompilerGenerated) 10957if (access.Kind == BoundKind.MethodGroup) 11116if (receiver.Kind == BoundKind.UnboundLambda)
Binder\Binder_Initializers.cs (2)
268if (statement.Kind == BoundKind.LabeledStatement) 271while (labeledStatementBody.Kind == BoundKind.LabeledStatement)
Binder\Binder_InterpolatedString.cs (1)
571_ => throw ExceptionUtilities.UnexpectedValue(unconvertedExpression.Kind)
Binder\Binder_Invocation.cs (27)
107if (!allowFieldsAndProperties && (boundExpression.Kind == BoundKind.FieldAccess || boundExpression.Kind == BoundKind.PropertyAccess)) 112if (boundExpression.Kind == BoundKind.FieldAccess) 124Debug.Assert(allowFieldsAndProperties || boundExpression.Kind is (BoundKind.MethodGroup or BoundKind.BadExpression)); 129Debug.Assert(!args.Any(static e => e.Kind == BoundKind.OutVariablePendingInference || 130e.Kind == BoundKind.OutDeconstructVarPendingInference || 131e.Kind == BoundKind.DiscardExpression && !e.HasExpressionType())); 145if (queryClause != null && result.Kind == BoundKind.DynamicInvocation) 161if (boundExpression.Kind == BoundKind.FieldAccess) 246string name = boundExpression.Kind == BoundKind.MethodGroup ? GetName(node.Expression) : null; 274if (argument.Kind == BoundKind.OutVariablePendingInference) 350else if (boundExpression.Kind == BoundKind.MethodGroup) 402if (expression.Kind == BoundKind.MethodGroup) 410switch (receiver.Kind) 585if (arg.Kind == BoundKind.Lambda || arg.Kind == BoundKind.UnboundLambda) 591else if (arg.Kind == BoundKind.MethodGroup) 597else if (arg.Kind == BoundKind.ArgListOperator) 1040switch (expression.Kind) 1056else if (call.ReceiverOpt.Kind == BoundKind.BaseReference && this.ContainingType.IsRestrictedType()) 1080throw ExceptionUtilities.UnexpectedValue(expression.Kind); 1265if (!gotError && method.RequiresInstanceReceiver && receiver != null && receiver.Kind == BoundKind.ThisReference && receiver.WasCompilerGenerated) 1281bool hasBaseReceiver = receiver != null && receiver.Kind == BoundKind.BaseReference; 1835switch (receiver.Kind) 1901if ((object)expr != null && expr.Kind != BoundKind.TypeExpression) 2179var originalMethods = (expr.Kind == BoundKind.MethodGroup) ? ((BoundMethodGroup)expr).Methods : ImmutableArray<MethodSymbol>.Empty; 2227if (!boundArgument.HasAnyErrors && syntaxIsOk && boundArgument.Kind == BoundKind.MethodGroup)
Binder\Binder_Operators.cs (17)
33if (left.Kind == BoundKind.EventAccess) 99if (left.Kind == BoundKind.EventAccess && !CheckEventValueKind((BoundEventAccess)left, BindValueKind.Assignable, diagnostics)) 241Debug.Assert(left.Kind != BoundKind.EventAccess || hasError); 474if (result.Kind == BoundKind.TypeExpression 479else if (result.Kind == BoundKind.BadExpression) 784_ => throw ExceptionUtilities.UnexpectedValue(current.Right.Kind) 834switch (left.Kind, right.Kind) 1946if (left.Kind == BoundKind.Conversion && right.Kind == BoundKind.Conversion) 2444switch (expr.Kind) 2568BoundKind exprKind = expr.Kind; 3157switch (operand.Kind) 3289operand.Kind == BoundKind.MethodGroup || 3705switch (operand.Kind) 4018if (leftOperand.Kind == BoundKind.UnboundLambda || leftOperand.Kind == BoundKind.MethodGroup)
Binder\Binder_Patterns.cs (6)
508wasExpression = expression.Kind != BoundKind.TypeExpression; 515Debug.Assert(expression is { Kind: BoundKind.TypeExpression, Type: { } }); 537wasExpression = expression.Kind switch { BoundKind.BadExpression => false, BoundKind.TypeExpression => false, _ => true }; 686if (convertedExpression.Kind == BoundKind.Conversion) 1561if (boundMember.Kind == BoundKind.PropertyGroup) 1569switch (boundMember.Kind)
Binder\Binder_Query.cs (7)
924while (ultimateReceiver.Kind == BoundKind.QueryClause) 947else if (ultimateReceiver.Kind == BoundKind.NamespaceExpression) 951else if (ultimateReceiver.Kind == BoundKind.Lambda || ultimateReceiver.Kind == BoundKind.UnboundLambda) 956else if (ultimateReceiver.Kind == BoundKind.MethodGroup) 977else if (ultimateReceiver.Kind == BoundKind.TypeExpression) 985else if (ultimateReceiver.Kind == BoundKind.TypeOrValueExpression)
Binder\Binder_QueryErrors.cs (1)
220if (arg.Kind == BoundKind.UnboundLambda)
Binder\Binder_Statements.cs (26)
152(result.Kind == BoundKind.Block && 892BoundExpression expression = value.Kind is BoundKind.UnboundLambda or BoundKind.MethodGroup ? 1245switch (initializerOpt.Kind) 1428bool discardAssignment = op1.Kind == BoundKind.DiscardExpression; 1494if (op1.Kind != BoundKind.DynamicIndexerAccess && 1495op1.Kind != BoundKind.DynamicMemberAccess && 1496op1.Kind != BoundKind.DynamicObjectInitializerMember) 1511if ((op1.Kind == BoundKind.EventAccess) && 1568else if (op1.Kind is BoundKind.Local or BoundKind.Parameter) 1580Debug.Assert(op1.Kind != BoundKind.Parameter); // If the assert fails, add a corresponding test. 1632switch (expr.Kind) 1665throw ExceptionUtilities.UnexpectedValue(implicitIndexerAccess.IndexerOrSliceAccess.Kind); 1716_ => throw ExceptionUtilities.UnexpectedValue(e.Kind) 1772(propertyIsStatic || receiver?.Kind == BoundKind.ThisReference); 1807else if (receiver.Kind == BoundKind.BaseReference) 1933if (expression.HasAnyErrors && expression.Kind != BoundKind.UnboundLambda) 2317switch (operand.Kind) 2437Debug.Assert(operand.HasAnyErrors && operand.Kind != BoundKind.UnboundLambda, "Missing a case in implicit conversion error reporting"); 2680if (expr.Kind == BoundKind.AssignmentOperator) 2683if (assignment.Right.Kind == BoundKind.Literal && assignment.Right.ConstantValueOpt.Discriminator == ConstantValueTypeDiscriminator.Boolean) 3157if (!argument.HasAnyErrors || argument.Kind == BoundKind.UnboundLambda) 3431if (expression.Kind == BoundKind.DelegateCreationExpression || expression.Kind == BoundKind.NameOfOperator) 3459if ((refKind != RefKind.None) != (returnRefKind != RefKind.None) && expression.Kind != BoundKind.ThrowExpression) 4116if (boundAccess.Kind != BoundKind.MethodGroup) 4142if (patternMethodCall.Kind != BoundKind.Call)
Binder\Binder_TupleOperators.cs (2)
217Debug.Assert((object)left.Type != null || left.Kind == BoundKind.TupleLiteral); 218Debug.Assert((object)right.Type != null || right.Kind == BoundKind.TupleLiteral);
Binder\DecisionDagBuilder.cs (16)
314throw ExceptionUtilities.UnexpectedValue(pattern.Kind); 962throw ExceptionUtilities.UnexpectedValue(n.Kind); 1061throw ExceptionUtilities.UnexpectedValue(n?.Kind); 1737return $"t{tempIdentifier(a)}={a.Kind}({tempName(a.Input)} as {a.Type})"; 1739return $"t{tempIdentifier(e)}={e.Kind}({tempName(e.Input)}.{e.Field.Name})"; 1741return $"t{tempIdentifier(e)}={e.Kind}({tempName(e.Input)}.{e.Property.Name})"; 1743return $"t{tempIdentifier(e)}={e.Kind}({tempName(e.Input)}[{e.Index}])"; 1745return $"{e.Kind}({tempName(e.Target)}<--{tempName(e.Input)})"; 1747return $"t{tempIdentifier(e)}={e.Kind}({tempName(e.Input)})"; 1749return $"?{d.Kind}({tempName(d.Input)} is {b.Type})"; 1751return $"?{d.Kind}({tempName(d.Input)} == {v.Value})"; 1761return $"?{d.Kind}({tempName(d.Input)} {operatorName} {r.Value})"; 1763return $"?{d.Kind}({tempName(d.Input)})"; 2431if (RemainingTests[0] is One { Test: { Kind: BoundKind.DagNonNullTest } planA }) 2438case One { Test: { Kind: BoundKind.DagTypeTest } planB1 }: 2445case One { Test: { Kind: BoundKind.DagValueTest } planB2 }:
Binder\ForEachLoopBinder.cs (1)
400if (iterationErrorExpression.Kind == BoundKind.DiscardExpression)
Binder\ForLoopBinder.cs (2)
108Debug.Assert(increment.Kind != BoundKind.StatementList || ((BoundStatementList)increment).Statements.Length > 1); 113if (increment.Kind == BoundKind.StatementList)
Binder\LockOrUsingBinder.cs (1)
59switch (expression.Kind)
Binder\PatternExplainer.cs (1)
164throw ExceptionUtilities.UnexpectedValue(currentNode.Kind);
Binder\RefSafetyAnalysis.cs (1)
541if (node.Left.Kind != BoundKind.DiscardExpression)
Binder\Semantics\Conversions\ConversionsBase.cs (4)
1059switch (sourceExpression.Kind) 1410if (sourceExpression.Kind == BoundKind.TupleLiteral) 1648if (source.Kind != BoundKind.UnboundLambda) 1951if (sourceExpressionOpt?.Kind == BoundKind.TupleLiteral)
Binder\Semantics\Operators\BinaryOperatorOverloadResolution.cs (1)
456&& nonDelegate.Kind == BoundKind.UnboundLambda)
Binder\Semantics\OverloadResolution\MethodGroup.cs (1)
112if (this.Receiver.Kind == BoundKind.TypeExpression)
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (14)
609if (argument.Kind == BoundKind.UnboundLambda && target.Type.GetDelegateType() is { }) 614else if (argument.Kind == BoundKind.UnconvertedCollectionExpression) 618else if (argument.Kind != BoundKind.TupleLiteral || 851if (argument.Kind == BoundKind.TupleLiteral && (object)argument.Type == null) 855else if (argument.Kind == BoundKind.UnconvertedCollectionExpression) 995if ((isFunctionPointer && argument.Kind != BoundKind.UnconvertedAddressOfOperator) || 996(!isFunctionPointer && argument.Kind is not (BoundKind.UnboundLambda or BoundKind.MethodGroup))) 1051if ((isFunctionPointer && argument.Kind != BoundKind.UnconvertedAddressOfOperator) || 1052(!isFunctionPointer && argument.Kind is not (BoundKind.UnboundLambda or BoundKind.MethodGroup))) 1420if (source.Kind is not (BoundKind.MethodGroup or BoundKind.UnconvertedAddressOfOperator)) 1431if (delegateOrFunctionPointerType.IsFunctionPointer() != (source.Kind == BoundKind.UnconvertedAddressOfOperator)) 1529if (source.Kind != BoundKind.UnboundLambda) 1583if (source.Kind != BoundKind.UnboundLambda) 3060if (source.Kind != BoundKind.UnboundLambda)
Binder\Semantics\OverloadResolution\OverloadResolution.cs (9)
2892var nodeKind = node.Kind; 3215if (node.Kind == BoundKind.TupleLiteral) 3231if (node.Kind == BoundKind.UnboundLambda && 3271if (lambda.Body.Statements[0].Kind == BoundKind.ReturnStatement) 3526if (node?.Kind == BoundKind.MethodGroup) 4406if (argument.Kind == BoundKind.ArgListOperator) 4575if (argument.Kind == BoundKind.OutVariablePendingInference || 4576argument.Kind == BoundKind.OutDeconstructVarPendingInference || 4577(argument.Kind == BoundKind.DiscardExpression && (object)argType == null))
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (12)
659if (receiverOpt?.Kind == BoundKind.QueryClause) 1208argument.Kind != BoundKind.OutDeconstructVarPendingInference && 1209argument.Kind != BoundKind.OutVariablePendingInference && 1210argument.Kind != BoundKind.DiscardExpression) 1216if (argument.Kind == BoundKind.UnboundLambda && refArg == refParameter) 1220else if (argument.Kind == BoundKind.MethodGroup && parameterType.TypeKind == TypeKind.Delegate && 1225else if (argument.Kind == BoundKind.MethodGroup && parameterType.TypeKind == TypeKind.FunctionPointer) 1229else if (argument.Kind == BoundKind.UnconvertedAddressOfOperator && 1234else if (argument.Kind == BoundKind.UnconvertedCollectionExpression) 1299Debug.Assert(argument.Kind != BoundKind.OutDeconstructVarPendingInference); 1300Debug.Assert(argument.Kind != BoundKind.OutVariablePendingInference); 1301Debug.Assert(argument.Kind != BoundKind.DiscardExpression || argument.HasExpressionType());
BoundTree\BoundDagEvaluation.cs (3)
27this.Kind == other.Kind && 45_ => throw ExceptionUtilities.UnexpectedValue(this.Kind)
BoundTree\BoundDagTest.cs (5)
20if (other is null || this.Kind != other.Kind) 46return Hash.Combine(((int)Kind).GetHashCode(), Input.GetHashCode()); 81return $"{e.GetOutputTempDebuggerDisplay()} = {e.Kind}({e.Input.GetDebuggerDisplay()})"; 102return $"{this.Kind}({this.Input.GetDebuggerDisplay()})";
BoundTree\BoundDecisionDag.cs (2)
42throw ExceptionUtilities.UnexpectedValue(node.Kind); 205return this.TopologicallySortedNodes.Any(static node => node is BoundEvaluationDecisionDagNode e && e.Evaluation.Kind == BoundKind.DagAssignmentEvaluation);
BoundTree\BoundExpression.cs (5)
56if ((Kind != BoundKind.Local && Kind != BoundKind.Parameter) || this.WasConverted) 74switch (Kind) 605return this.Condition.Kind == BoundKind.UnaryOperator && ((BoundUnaryOperator)this.Condition).OperatorKind.IsDynamic(); 731if (argument.Kind == BoundKind.TupleLiteral)
BoundTree\BoundExpressionExtensions.cs (9)
22switch (node.Kind) 83return node is { Kind: BoundKind.Literal, ConstantValueOpt: { Discriminator: ConstantValueTypeDiscriminator.Null } }; 88return node.Kind == BoundKind.DefaultLiteral; 93return node.Kind == BoundKind.UnconvertedObjectCreationExpression; 109if (node.Kind == BoundKind.DefaultExpression || node.Kind == BoundKind.DefaultLiteral) 137Debug.Assert(expr.Kind is BoundKind.MethodGroup or BoundKind.UnboundLambda); 170switch (node.Kind) 242switch (boundNode.Kind)
BoundTree\BoundMethodGroup.cs (1)
61if (this.ReceiverOpt == null || this.ReceiverOpt.Kind == BoundKind.TypeExpression)
BoundTree\BoundNode_Source.cs (1)
362appendLine(node.Kind.ToString());
BoundTree\BoundNodeExtensions.cs (8)
42if (statement!.Kind == BoundKind.ExpressionStatement) 45if (expression.Kind == BoundKind.Sequence && ((BoundSequence)expression).SideEffects.IsDefaultOrEmpty) 51return expression.Kind == BoundKind.Call && ((BoundCall)expression).IsConstructorInitializer(); 64(receiverOpt.Kind == BoundKind.ThisReference || receiverOpt.Kind == BoundKind.BaseReference); 131throw ExceptionUtilities.UnexpectedValue(current.Left.Kind); 146throw ExceptionUtilities.UnexpectedValue(current.Right.Kind); 256_ => throw ExceptionUtilities.UnexpectedValue(e.Kind),
BoundTree\BoundStatementExtensions.cs (4)
16switch (node.Kind) 23throw ExceptionUtilities.UnexpectedValue(node.Kind); 32switch (node.Kind) 53throw ExceptionUtilities.UnexpectedValue(node.Kind);
BoundTree\BoundTreeRewriter.cs (4)
113if (child.Kind != BoundKind.BinaryOperator) 128if (child.Kind != BoundKind.BinaryOperator) 202if (child.Kind != BoundKind.BinaryPattern) 217if (child.Kind != BoundKind.BinaryPattern)
BoundTree\BoundTreeVisitors.cs (1)
31switch (node.Kind)
BoundTree\BoundTreeWalker.cs (2)
121while (current.Kind == BoundKind.BinaryOperator) 159while (current.Kind == BoundKind.BinaryPattern)
BoundTree\Constructors.cs (2)
69switch (receiver.Kind) 206Debug.Assert(method is ErrorMethodSymbol || arguments[i].Kind == BoundKind.ArgListOperator);
BoundTree\Expression.cs (2)
170(this.Kind == BoundKind.StatementList || this.Kind == BoundKind.Scope) ? StaticCast<BoundNode?>.From(this.Statements) : ImmutableArray<BoundNode?>.Empty;
BoundTree\NullabilityRewriter.cs (1)
109_ => throw ExceptionUtilities.UnexpectedValue(currentBinary.Kind),
CodeGen\EmitAddress.cs (4)
28switch (expression.Kind) 89throw ExceptionUtilities.UnexpectedValue(expression.Kind); 355switch (value.Kind) 524if (receiver.Kind != BoundKind.ConditionalReceiver)
CodeGen\EmitArrayInitializer.cs (4)
348if (inits[0].Kind == BoundKind.ArrayInitialization) 370Debug.Assert(inits.All((init) => init.Kind != BoundKind.ArrayInitialization) || 371inits.All((init) => init.Kind == BoundKind.ArrayInitialization), 374return inits.Length != 0 && inits[0].Kind == BoundKind.ArrayInitialization;
CodeGen\EmitExpression.cs (30)
96switch (expression.Kind) 174throw ExceptionUtilities.UnexpectedValue(expression.Kind); 362Debug.Assert(expression.Kind != BoundKind.BadExpression); 365throw ExceptionUtilities.UnexpectedValue(expression.Kind); 444(receiver.Kind == BoundKind.Local && IsStackLocal(((BoundLocal)receiver).LocalSymbol)) || 859Debug.Assert(sequence.Value.Kind != BoundKind.TypeExpression || !used); 860if (sequence.Value.Kind != BoundKind.TypeExpression) 1002Debug.Assert(arguments[i].Kind == BoundKind.ArgListOperator); 1231else if (receiver.Kind == BoundKind.Conversion) 1242else if (receiver.Kind == BoundKind.FieldAccess) 1273if (receiver.Kind == BoundKind.Conversion && ((BoundConversion)receiver).ConversionKind == ConversionKind.Unboxing) 1284switch (receiver.Kind) 1516Debug.Assert(receiver.Kind != BoundKind.BaseReference, "base should always use call"); 1525switch (receiver.Kind) 1598switch (receiver.Kind) 1646Debug.Assert(receiver.Kind == BoundKind.ThisReference); 2128switch (current.Kind) 2211switch (receiver.Kind) 2620if (objCreation.Arguments.Length > 0 && objCreation.Arguments[0].Kind == BoundKind.ConvertedStackAllocExpression) 2654if (left.Kind == BoundKind.ArrayAccess && left.Type.TypeKind == TypeKind.TypeParameter && !left.Type.IsValueType) 2659if (left.Kind == BoundKind.FieldAccess) 2754switch (left.Kind) 2773switch (assignmentTarget.Kind) 2954throw ExceptionUtilities.UnexpectedValue(assignmentTarget.Kind); 2975throw ExceptionUtilities.UnexpectedValue(assignmentTarget.Kind); 3004Debug.Assert(lhs.Kind != BoundKind.Parameter || exprTempsAfter <= exprTempsBefore); 3006if (lhs.Kind == BoundKind.Local && ((BoundLocal)lhs).LocalSymbol.SynthesizedKind.IsLongLived()) 3062switch (expression.Kind) 3162throw ExceptionUtilities.UnexpectedValue(expression.Kind); 3916switch (expr.Kind)
CodeGen\EmitOperators.cs (3)
94if (child.Kind != BoundKind.BinaryOperator || child.ConstantValueOpt != null) 118if (child.Kind != BoundKind.BinaryOperator || child.ConstantValueOpt != null) 507if (condition.Kind == BoundKind.BinaryOperator)
CodeGen\EmitStatement.cs (10)
29switch (statement.Kind) 105throw ExceptionUtilities.UnexpectedValue(statement.Kind); 416switch (condition.Kind) 536(receiver.Kind == BoundKind.Local && IsStackLocal(((BoundLocal)receiver).LocalSymbol)) || 1135while (exceptionSource.Kind == BoundKind.Sequence) 1143switch (exceptionSource.Kind) 1182throw ExceptionUtilities.UnexpectedValue(exceptionSource.Kind); 1264if (expression.Kind == BoundKind.Sequence) 1272if (expression.Kind == BoundKind.SequencePointExpression) 1279switch (expression.Kind)
CodeGen\Optimizer.cs (17)
451Debug.Assert(expr.Kind != BoundKind.Label); 762if (value != null && value.Kind == BoundKind.Local && ((BoundLocal)value).LocalSymbol == local) 770if (lastSideeffect.Kind == BoundKind.AssignmentOperator) 774assignment.Right.Kind == BoundKind.Sequence) 950bool mayPushReceiver = (right.Kind == BoundKind.ObjectCreationExpression && 996assignmentLocal.Type.IsPointerOrFunctionPointer() && right.Kind == BoundKind.Conversion && 1031(lhs.Kind is BoundKind.Local or BoundKind.Parameter or BoundKind.FieldAccess && lhs.GetRefKind() != RefKind.None), 1034switch (lhs.Kind) 1093throw ExceptionUtilities.UnexpectedValue(lhs.Kind); 1100if (lhs.Kind == BoundKind.FieldAccess) 1425if (boundExpression.Kind == BoundKind.Local) 1477if (child.Kind != BoundKind.BinaryOperator || child.ConstantValueOpt != null) 1493if (child.Kind != BoundKind.BinaryOperator || child.ConstantValueOpt != null) 1697if (exceptionSourceOpt.Kind == BoundKind.Local) 2071if (child.Kind != BoundKind.BinaryOperator || child.ConstantValueOpt != null) 2087if (child.Kind != BoundKind.BinaryOperator || child.ConstantValueOpt != null) 2299if (exceptionSource.Kind == BoundKind.Local)
Compilation\CSharpSemanticModel.cs (14)
1924else if (highestBoundExpr.Kind == BoundKind.TypeOrValueExpression) 1930else if (highestBoundExpr.Kind == BoundKind.UnaryOperator) 2085var highestBoundExprKind = highestBoundExpr?.Kind ?? BoundKind.NoOpStatement; 2106if (tupleLiteralConversion.Operand.Kind == BoundKind.ConvertedTupleLiteral) 2195else if (((BoundConversion)highestBoundExpr).Operand.Kind != BoundKind.Conversion) 2213else if (boundNodeForSyntacticParent?.Kind == BoundKind.DelegateCreationExpression) 2218switch (boundExpr.Kind) 2300if (boundExpr != null && boundExpr.Kind != BoundKind.TypeExpression) 3355switch (boundNode.Kind) 3399boundNodeForSyntacticParent.Kind == BoundKind.BadExpression && 3980switch (boundNodeForSyntacticParent.Kind) 4006throw ExceptionUtilities.UnexpectedValue(boundNodeForSyntacticParent.Kind); 4259switch (boundNodeForSyntacticParent.Kind) 4401switch (boundNodeForSyntacticParent.Kind)
Compilation\MemberSemanticModel.cs (5)
1200Debug.Assert(highestBoundNode.Kind != BoundKind.UnboundLambda); 1742switch (boundInnerLambdaOrQuery.Kind) 1771switch (node.Kind) 1789while (receiver?.Kind == BoundKind.MethodGroup) 1856if (expr.Kind == BoundKind.QueryClause)
Compilation\MemberSemanticModel.NodeMapBuilder.cs (1)
169if (node.Kind == BoundKind.UnboundLambda)
Compiler\MethodBodySynthesizer.Lowered.cs (1)
333if (body.Kind != BoundKind.Block) body = F.Block(body);
Compiler\MethodCompiler.cs (4)
598(init.Kind == BoundKind.FieldEqualsValue) && !((BoundFieldEqualsValue)init).Field.IsMetadataConstant)); 1292if (processedInitializers.LoweredInitializers.Kind == BoundKind.StatementList) 1848switch (methodBody.Kind) 1890throw ExceptionUtilities.UnexpectedValue(methodBody.Kind);
FlowAnalysis\AbstractFlowPass.cs (11)
554switch (node?.Kind) 897RoslynDebug.Assert(false, $"Should Visit{node.Kind} be overridden in {this.GetType().Name}?"); 1023throw ExceptionUtilities.UnexpectedValue(pattern.Kind); 1076throw ExceptionUtilities.UnexpectedValue(pattern.Kind); 1864if (pend.Branch.Kind != BoundKind.YieldReturnStatement) 2124if (expr.Kind != BoundKind.PropertyAccess) 2157var refKind = node.Left.Kind == BoundKind.BadExpression 2238receiverOpt.Kind != BoundKind.TypeExpression && 2419var childKind = child.Kind; 2457switch (binary.Kind) 2470throw ExceptionUtilities.UnexpectedValue(binary.Kind);
FlowAnalysis\ControlFlowPass.cs (3)
214switch (pending.Branch.Kind) 242switch (statement.Kind) 304switch (branch.Branch.Kind)
FlowAnalysis\DataFlowsOutWalker.cs (2)
118switch (node.Kind) 239switch (node.Kind)
FlowAnalysis\DefiniteAssignment.cs (21)
241if (node.Kind == BoundKind.Attribute) 427BoundKind kind = pendingBranch.Kind; 785Debug.Assert(fieldOrEventAccess.Kind == BoundKind.FieldAccess || fieldOrEventAccess.Kind == BoundKind.EventAccess); 789switch (n.Kind) 921if (value is { ConstantValueOpt: not null, Kind: not BoundKind.InterpolatedString }) return false; 923switch (value.Kind) 961switch (n.Kind) 978if (n.Kind == BoundKind.Local) 1070switch (expr.Kind) 1124receiver.Kind != BoundKind.TypeExpression && 1141receiverOpt.Kind != BoundKind.TypeExpression && 1382switch (node.Kind) 1485switch (expression.Kind) 1537switch (node.Kind) 1991switch (pattern.Kind) 2118throw ExceptionUtilities.UnexpectedValue(pattern.Kind); 2193if (stmt.Kind != BoundKind.LocalFunctionStatement) 2449if (pending.Branch.Kind == BoundKind.ReturnStatement) 2523if (initializer.Kind == BoundKind.AddressOfOperator) 2594switch (expr.Kind)
FlowAnalysis\ExitPointsWalker.cs (2)
125switch (pending.Branch.Kind) 148throw ExceptionUtilities.UnexpectedValue(pending.Branch.Kind);
FlowAnalysis\LocalDataFlowPass.cs (1)
213switch (node.Kind)
FlowAnalysis\NullableWalker.cs (33)
431private bool IsAnalyzingAttribute => methodMainNode.Kind == BoundKind.Attribute; 539Debug.Assert(expression != null || placeholder.Kind == BoundKind.InterpolatedStringArgumentPlaceholder); 558switch (placeholder.Kind) 574throw ExceptionUtilities.UnexpectedValue(placeholder.Kind); 1944switch (expr.Kind) 1993receiver.Kind != BoundKind.TypeExpression && 2019switch (node.Kind) 2488switch (expr.Kind) 2955if (!expr.IsSuppressed && RemoveConversion(expr, includeExplicitConversions: false).expression.Kind != BoundKind.ThrowExpression) 3961Debug.Assert(node.Kind is BoundKind.ObjectCreationExpression or BoundKind.DynamicObjectCreationExpression or BoundKind.NewT or BoundKind.NoPiaObjectCreationExpression); 4051switch (initializer.Kind) 4066switch (initializer.Kind) 4079ExceptionUtilities.UnexpectedValue(node.Kind); 4096switch (left.Kind) 4352Debug.Assert(node.ImplicitReceiverOpt.Kind == BoundKind.ObjectOrCollectionValuePlaceholder); 4767if (child.Kind == BoundKind.ArrayInitialization) 5331switch (operand.Kind) 5527while (possiblyConversion.Kind == BoundKind.Conversion) 7291return (argument.Kind == BoundKind.Lambda); 7896switch (expr.Kind) 7948if (argument.Kind == BoundKind.Lambda) 7957if (argument.Kind == BoundKind.CollectionExpression) 8049if (expr.Kind != BoundKind.Conversion) 8132switch (value.Kind) 8971if (operandType.Type?.IsTupleType == true || conversionOperand.Kind == BoundKind.TupleLiteral) 9948if (left.Kind == BoundKind.EventAccess && ((BoundEventAccess)left).EventSymbol.IsWindowsRuntimeEvent) 10363switch (expr.Kind) 10381switch (expr.Kind) 10580if (initializer.Kind == BoundKind.AddressOfOperator) 10586if (node.Expression.Kind == BoundKind.AddressOfOperator) 10838if (node.Expression.Kind != BoundKind.Conversion) 11364switch (node.Kind) 11384throw ExceptionUtilities.UnexpectedValue(node.Kind);
FlowAnalysis\NullableWalker.DebugVerifier.cs (2)
73else if (overrideSkippedExpression || !s_skippedExpressions.Contains(expression.Kind)) 164if (!s_skippedExpressions.Contains(child.Kind))
FlowAnalysis\NullableWalker.SnapshotManager.cs (1)
106if (node.Kind == BoundKind.TypeExpression || node.WasCompilerGenerated)
FlowAnalysis\NullableWalker_Patterns.cs (4)
583throw ExceptionUtilities.UnexpectedValue(p.Evaluation.Kind); 660throw ExceptionUtilities.UnexpectedValue(test.Kind); 719throw ExceptionUtilities.UnexpectedValue(dagNode.Kind); 858_ => throw ExceptionUtilities.UnexpectedValue(e.Kind)
FlowAnalysis\ReadWriteWalker.cs (4)
142if (!IsInside && node.Span.Contains(RegionSpan) && (expr.Kind == BoundKind.FieldAccess)) 183switch (receiver.Kind) 233switch (node.Kind) 299switch (underlying.Kind)
FlowAnalysis\RegionAnalysisContext.cs (1)
49switch (firstInRegion.Kind)
Generated\BoundNodes.xml.Generated.cs (1)
8830switch (node.Kind)
Lowering\AsyncRewriter\AsyncMethodToStateMachineRewriter.cs (3)
307if (node.Expression.Kind == BoundKind.AwaitExpression) 311else if (node.Expression.Kind == BoundKind.AssignmentOperator) 314if (expression.Right.Kind == BoundKind.AwaitExpression)
Lowering\ClosureConversion\ClosureConversion.Analysis.cs (2)
108switch (node.Kind) 128throw ExceptionUtilities.UnexpectedValue(node.Kind);
Lowering\ClosureConversion\ClosureConversion.cs (3)
1104if (visited.Kind != BoundKind.Call) 1333if (node.Argument.Kind == BoundKind.Lambda) 1380receiver.Kind == BoundKind.TypeExpression &&
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (7)
138switch (stmt.Kind) 157throw ExceptionUtilities.UnexpectedValue(stmt.Kind); 181switch (node.Kind) 249throw ExceptionUtilities.UnexpectedValue(node.Kind); 533if (operand.Kind == BoundKind.Conversion) 787if (node.Argument.Kind == BoundKind.MethodGroup) 943switch (node.Kind)
Lowering\DiagnosticsPass_ExpressionTrees.cs (8)
253if (_inExpressionLambda && node.Left.Kind != BoundKind.ObjectInitializerMember && node.Left.Kind != BoundKind.DynamicObjectInitializerMember) 277bool hasBaseReceiver = node.ReceiverOpt != null && node.ReceiverOpt.Kind == BoundKind.BaseReference; 291bool hasBaseReceiver = node.ReceiverOpt != null && node.ReceiverOpt.Kind == BoundKind.BaseReference; 665if (current.Left.Kind == BoundKind.BinaryOperator) 753if (operand.Kind == BoundKind.FieldAccess) 853if (node.Argument.Kind != BoundKind.MethodGroup) 937if (node.Expression.Kind == BoundKind.MethodGroup)
Lowering\DiagnosticsPass_Warnings.cs (18)
31switch (argument.Kind) 97if (receiverOpt != null && receiverOpt.Kind == BoundKind.FieldAccess) 141while (receiver.Kind == BoundKind.Conversion) 148return receiver.Kind != BoundKind.ThisReference && receiver.Kind != BoundKind.BaseReference; 196if (expr1.Kind != expr2.Kind) 201switch (expr1.Kind) 317if (node.Left.ConstantValueOpt != null && node.Right.ConstantValueOpt == null && node.Right.Kind == BoundKind.Conversion) 322if (node.Right.ConstantValueOpt != null && node.Left.ConstantValueOpt == null && node.Left.Kind == BoundKind.Conversion) 347return node.Kind == BoundKind.Conversion && ((BoundConversion)node).ExplicitCastInCode; 353if (node.Kind != BoundKind.Conversion) return false; 577if (operand.Kind == BoundKind.Conversion) 606if (expr.Kind != BoundKind.Conversion) 865if (node.Kind == BoundKind.Conversion) 889while (right.Kind == BoundKind.Conversion) 904if (right.Kind != BoundKind.ConvertedTupleLiteral && right.Kind != BoundKind.TupleLiteral)
Lowering\Extensions.cs (4)
51if (expr.Kind == BoundKind.ObjectCreationExpression) 56else if (expr.Kind == BoundKind.Conversion) 97if (expr.Kind == BoundKind.ObjectCreationExpression) 103if (expr.Kind == BoundKind.Conversion)
Lowering\InitializerRewriter.cs (4)
46(initializer.Kind == BoundKind.GlobalStatementInitializer) && 84return (statement.Kind == BoundKind.ExpressionStatement) && ((ExpressionStatementSyntax)statement.Syntax).SemicolonToken.IsMissing ? 121switch (initializer.Kind) 128throw ExceptionUtilities.UnexpectedValue(initializer.Kind);
Lowering\Instrumentation\CodeCoverageInstrumenter.cs (1)
527switch (statement.Kind)
Lowering\Instrumentation\DebugInfoInjector.cs (1)
123if (rewritten.Kind == BoundKind.Block)
Lowering\Instrumentation\Instrumenter.cs (1)
307Debug.Assert(original.Kind == BoundKind.SwitchStatement);
Lowering\LocalRewriter\LocalRewriter.cs (12)
286node.Kind is not (BoundKind.ImplicitReceiver or BoundKind.ObjectOrCollectionValuePlaceholder or BoundKind.ValuePlaceholder)) 309return node.Kind == BoundKind.DeconstructionAssignmentOperator && !((BoundDeconstructionAssignmentOperator)node).IsUsed; 709if (initializer.Kind == BoundKind.Block) 879switch (initializer.Kind) 886if (initializer.Kind == BoundKind.ExpressionStatement) 894return ((BoundExpressionStatement)initializer).Expression.Kind == BoundKind.AssignmentOperator; 911if (statement.Kind != BoundKind.ExpressionStatement) 922Debug.Assert(assignment.Left.Kind == BoundKind.FieldAccess); 1018switch (expr.Kind) 1114throw ExceptionUtilities.UnexpectedValue(expr.Kind); 1120RoslynDebug.Assert(expr is not BoundValuePlaceholderBase, $"Placeholder kind {expr.Kind} must be handled explicitly"); 1258RoslynDebug.Assert(false, $"Bound nodes of kind {node.Kind} should not survive past local rewriting");
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (4)
89throw ExceptionUtilities.UnexpectedValue(node.Kind); 972if (!sortedNodes.Any(static n => n.Kind == BoundKind.WhenDecisionDagNode)) return; 1184Debug.Assert(left.Kind == BoundKind.Local && left == binding.VariableAccess); 1233throw ExceptionUtilities.UnexpectedValue(node.Kind);
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (4)
519if ((loweredInput.Kind == BoundKind.Local || loweredInput.Kind == BoundKind.Parameter) 644if (canShareInputs && (expr.Kind == BoundKind.Parameter || expr.Kind == BoundKind.Local) && _tempAllocator.TrySetTemp(temp, expr))
Lowering\LocalRewriter\LocalRewriter_AssignmentOperator.cs (5)
27switch (left.Kind) 94switch (rewrittenLeft.Kind) 173switch (rewrittenLeft.Kind) 177throw ExceptionUtilities.UnexpectedValue(rewrittenLeft.Kind); 241if (sequence.Value.Kind == BoundKind.IndexerAccess)
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (13)
284if (loweredRight.Kind == BoundKind.Local || loweredRight.Kind == BoundKind.Parameter) 296if (loweredRight.Kind == BoundKind.Local || loweredRight.Kind == BoundKind.Parameter) 483if (loweredLeft.Kind == BoundKind.ArrayLength && loweredRight.IsDefaultValue()) 498if (loweredRight.Kind == BoundKind.ArrayLength && loweredLeft.IsDefaultValue()) 513if (loweredLeft.Kind == BoundKind.ArrayLength && loweredRight.IsDefaultValue()) 517else if (loweredRight.Kind == BoundKind.ArrayLength && loweredLeft.IsDefaultValue()) 652if (constantLeft == null && loweredLeft.Kind != BoundKind.Local && loweredLeft.Kind != BoundKind.Parameter) 713if (expression.Kind == BoundKind.Conversion) 1608if (nonNullRight != null && nonNullRight.ConstantValueOpt != null && left.Kind == BoundKind.Sequence) 1611if (seq.Value.Kind == BoundKind.ConditionalOperator)
Lowering\LocalRewriter\LocalRewriter_Block.cs (1)
109switch (node.Kind)
Lowering\LocalRewriter\LocalRewriter_Call.cs (5)
34switch (node.Expression.Kind) 44Debug.Assert(methodGroup.ReceiverOpt == null || methodGroup.ReceiverOpt.Kind != BoundKind.TypeOrValueExpression); 551switch (current.Kind) 1538if (argument.Kind == BoundKind.Local) 1627if (argument.Kind == BoundKind.Local)
Lowering\LocalRewriter\LocalRewriter_CompoundAssignmentOperator.cs (7)
41if (node.Left.Kind == BoundKind.DynamicMemberAccess && 189Debug.Assert(receiverOpt.Kind != BoundKind.TypeExpression); 480Debug.Assert(receiver.Kind != BoundKind.TypeExpression); 590switch (originalLHS.Kind) 741throw ExceptionUtilities.UnexpectedValue(originalLHS.Kind); 840switch (expression.Kind) 882switch (expression.Kind)
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (4)
31_ => throw ExceptionUtilities.UnexpectedValue(node.Operand.Kind) 233switch (rewrittenNode.Kind) 1305if (operand.Kind == BoundKind.Sequence) 1308if (seq.Value.Kind == BoundKind.ConditionalOperator)
Lowering\LocalRewriter\LocalRewriter_DeconstructionAssignmentOperator.cs (11)
62if (right.Kind == BoundKind.ConditionalOperator) 114Debug.Assert(right is not ({ Kind: BoundKind.TupleLiteral } or BoundConversion { Operand.Kind: BoundKind.TupleLiteral })); 117right is { Kind: BoundKind.ConvertedTupleLiteral } or BoundConversion { Operand.Kind: BoundKind.ConvertedTupleLiteral } 252if (leftTarget.Kind != BoundKind.DiscardExpression) 285Debug.Assert(!IsTupleExpression(right.Kind)); 296if (IsTupleExpression(right.Kind)) 304if (right.Kind == BoundKind.Conversion) 308&& IsTupleExpression(tupleConversion.Operand.Kind)) 449switch (variable.Kind)
Lowering\LocalRewriter\LocalRewriter_DelegateCreationExpression.cs (1)
28if (node.Argument.Kind == BoundKind.MethodGroup)
Lowering\LocalRewriter\LocalRewriter_ExpressionStatement.cs (1)
48switch (expression.Kind)
Lowering\LocalRewriter\LocalRewriter_Field.cs (1)
66if (rewrittenReceiver?.Kind == BoundKind.DefaultExpression)
Lowering\LocalRewriter\LocalRewriter_FixedStatement.cs (1)
245Debug.Assert(initializerExpr.Kind == BoundKind.AddressOfOperator);
Lowering\LocalRewriter\LocalRewriter_ForStatement.cs (3)
51Debug.Assert(original.Kind is BoundKind.ForStatement or BoundKind.ForEachStatement or BoundKind.CollectionExpressionSpreadElement); 146switch (original.Kind) 159throw ExceptionUtilities.UnexpectedValue(original.Kind);
Lowering\LocalRewriter\LocalRewriter_IndexerAccess.cs (6)
497if (node.LengthOrCountAccess.Kind is not BoundKind.Local || receiver.Kind is not (BoundKind.Local or BoundKind.Parameter)) 539if (makeOffsetInput.ConstantValueOpt is null && lengthAccess.Kind is not BoundKind.ArrayLength) 799if (node.LengthOrCountAccess.Kind is not BoundKind.Local || receiver.Kind is not (BoundKind.Local or BoundKind.Parameter)) 950if ((rewriteFlags & captureLength) != 0 && lengthAccess.Kind is not BoundKind.Local)
Lowering\LocalRewriter\LocalRewriter_IsOperator.cs (2)
33if (rewrittenOperand.Kind == BoundKind.MethodGroup) 37if (receiver != null && receiver.Kind != BoundKind.ThisReference)
Lowering\LocalRewriter\LocalRewriter_IsPatternOperator.cs (3)
244while (node.Kind != BoundKind.LeafDecisionDagNode && node.Kind != BoundKind.WhenDecisionDagNode) 299throw ExceptionUtilities.UnexpectedValue(node.Kind);
Lowering\LocalRewriter\LocalRewriter_NullCoalescingAssignmentOperator.cs (2)
90Debug.Assert(!_inExpressionLambda && lhsRead.Kind != BoundKind.PropertyAccess); 94if (lhsRead.Kind == BoundKind.Call)
Lowering\LocalRewriter\LocalRewriter_NullCoalescingOperator.cs (2)
192if (expression.Kind != BoundKind.Call) 221while (expression.Kind == BoundKind.Conversion)
Lowering\LocalRewriter\LocalRewriter_ObjectOrCollectionInitializerExpression.cs (11)
27throw ExceptionUtilities.UnexpectedValue(initializerExpression.Kind); 62throw ExceptionUtilities.UnexpectedValue(initializerExpression.Kind); 70switch (initializerExpression.Kind) 81throw ExceptionUtilities.UnexpectedValue(initializerExpression.Kind); 98if (initializer.Kind == BoundKind.CollectionElementInitializer) 105Debug.Assert(initializer.Kind == BoundKind.DynamicCollectionElementInitializer); 281bool isRhsNestedInitializer = right.Kind is BoundKind.ObjectInitializerExpression or BoundKind.CollectionInitializerExpression; 292switch (left.Kind) 432throw ExceptionUtilities.UnexpectedValue(rewrittenArrayAccess.Kind); 514throw ExceptionUtilities.UnexpectedValue(left.Kind); 576throw ExceptionUtilities.UnexpectedValue(lhs.Kind);
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (1)
615if (expr.Kind == BoundKind.Conversion)
Lowering\LocalRewriter\LocalRewriter_StringInterpolation.cs (2)
84throw ExceptionUtilities.UnexpectedValue(part.Kind); 191if (length == 1 && result is not ({ Kind: BoundKind.InterpolatedString } or { ConstantValueOpt.IsString: true }))
Lowering\LocalRewriter\LocalRewriter_TryStatement.cs (1)
50switch (statement.Kind)
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (5)
45if (node.Operand.Kind == BoundKind.BinaryOperator) 321if (loweredOperand.Kind == BoundKind.Sequence) 324if (seq.Value.Kind == BoundKind.ConditionalOperator) 486switch (expression.Kind) 862switch (transformedExpression.Kind)
Lowering\LocalRewriter\LocalRewriter_UsingStatement.cs (1)
40BoundBlock tryBlock = rewrittenBody.Kind == BoundKind.Block
Lowering\LocalRewriter\LocalRewriter_WhileStatement.cs (3)
49Debug.Assert(loop.Kind is BoundKind.WhileStatement or BoundKind.ForEachStatement or BoundKind.CollectionExpressionSpreadElement); 72switch (loop.Kind) 88throw ExceptionUtilities.UnexpectedValue(loop.Kind);
Lowering\LocalRewriter\LoweredDynamicOperationFactory.cs (1)
225if (loweredReceiver.Kind == BoundKind.TypeExpression)
Lowering\MethodToClassRewriter.cs (7)
70Debug.Fail($"Override the visitor for {node.Kind}"); 484if (originalLeft.Kind != BoundKind.Local) 498Debug.Assert(originalRight.Kind != BoundKind.ConvertedStackAllocExpression); 520if (rewrittenLeft.Kind != BoundKind.Local && originalRight.Kind == BoundKind.ConvertedStackAllocExpression) 727return originalReceiver is { Kind: BoundKind.BaseReference } && 728rewrittenReceiver is { Kind: not BoundKind.BaseReference };
Lowering\SpillSequenceSpiller.cs (7)
47Debug.Assert(value?.Kind != SpillSequenceBuilderKind); 247if (e == null || e.Kind != SpillSequenceBuilderKind) 314switch (expression.Kind) 352assignment is not { Left.Kind: BoundKind.Local, Right.Kind: BoundKind.ArrayAccess }) // Optimize for some known to be safe scenarios. 611if (newList[i].Kind == SpillSequenceBuilderKind) 872switch (left.Kind)
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (1)
295if (node.ReceiverOpt != null && node.ReceiverOpt.Kind == BoundKind.ThisReference)
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (6)
408if (statement.Kind == BoundKind.Block) 412if (rewrittenStatements.Length == 1 && rewrittenStatements[0].Kind == BoundKind.StateMachineScope) 566switch (expr.Kind) 601if (receiver.Kind != BoundKind.ThisReference && !isFieldOfStruct) 658throw ExceptionUtilities.UnexpectedValue(expr.Kind); 811if (node.Left.Kind != BoundKind.Local)
Lowering\SyntheticBoundNodeFactory.cs (2)
572if (body.Kind != BoundKind.Block) 1728var discardsPresent = arguments.Any(static a => a.Kind == BoundKind.DiscardExpression);
Operations\CSharpOperationFactory.cs (31)
35switch (boundNode.Kind) 312switch (boundNode.Kind) 333throw ExceptionUtilities.UnexpectedValue(boundNode.Kind); 398switch (declaration.Kind) 416throw ExceptionUtilities.UnexpectedValue(declaration.Kind); 522switch (declaration.Kind) 548throw ExceptionUtilities.UnexpectedValue(declaration.Kind); 608throw ExceptionUtilities.UnexpectedValue(boundNode.Kind); 799throw ExceptionUtilities.UnexpectedValue(indexer.Kind); 815throw ExceptionUtilities.UnexpectedValue(indexer.Kind); 958if (receiver?.Kind == BoundKind.TypeExpression) 1070Debug.Assert(boundOperand.Kind == BoundKind.BadExpression || 1072ExpressionOpt?.Kind == BoundKind.BadExpression); 1082if (boundOperand.Kind == BoundKind.ConvertedTupleLiteral && TypeSymbol.Equals(boundOperand.Type, boundConversion.Type, TypeCompareKind.ConsiderEverything2)) 1096if (boundConversion.ExplicitCastInCode && conversion.IsIdentity && boundOperand.Kind == BoundKind.Conversion) 1102nestedOperand.Kind == BoundKind.ConvertedTupleLiteral && 1118if ((boundOperand.Kind == BoundKind.Lambda || 1119boundOperand.Kind == BoundKind.UnboundLambda || 1120boundOperand.Kind == BoundKind.MethodGroup) && 1327boundAssignmentOperator.Right?.Kind == BoundKind.ObjectInitializerExpression || 1328boundAssignmentOperator.Right?.Kind == BoundKind.CollectionInitializerExpression; 1475{ Kind: var kind } => throw ExceptionUtilities.UnexpectedValue(kind) 1643if (boundIndexerAccess.LengthOrCountAccess.Kind == BoundKind.ArrayLength) 2247{ Kind: var kind } => throw ExceptionUtilities.UnexpectedValue(kind) 2280if (part.Kind == BoundKind.StringInsert) 2340throw ExceptionUtilities.UnexpectedValue(part.Kind); 2356_ => throw ExceptionUtilities.UnexpectedValue(value.Kind), 2476throw ExceptionUtilities.UnexpectedValue(current.Kind); 2539if (variable == null && boundDeclarationPattern.VariableAccess?.Kind == BoundKind.DiscardExpression) 2753Debug.Assert(boundSwitchLabel.Pattern.Kind == BoundKind.DiscardPattern); 2757boundSwitchLabel.Pattern.Kind == BoundKind.ConstantPattern &&
Operations\CSharpOperationFactory_Methods.cs (9)
25if (statement.Kind == BoundKind.StatementList) 100if (instance == null || instance.Kind == BoundKind.TypeExpression) 106if (symbol != null && symbol.IsStatic && instance.WasCompilerGenerated && instance.Kind == BoundKind.ThisReference) 163if (boundDelegateCreationExpression.Argument.Kind == BoundKind.MethodGroup && 196switch (containingExpression.Kind) 260throw ExceptionUtilities.UnexpectedValue(containingExpression.Kind); 393|| (receiverOpt.Kind != BoundKind.ThisReference 394&& receiverOpt.Kind != BoundKind.BaseReference 395&& receiverOpt.Kind != BoundKind.ObjectOrCollectionValuePlaceholder)))
Symbols\ConstantValueUtils.cs (1)
97while (unconvertedBoundValue.Kind == BoundKind.Conversion)
Symbols\FunctionTypeSymbol.cs (1)
68Debug.Assert(expression.Kind is BoundKind.MethodGroup or BoundKind.UnboundLambda);
Symbols\Source\ParameterHelpers.cs (1)
884switch (expression.Kind)
Symbols\Source\SourceComplexParameterSymbol.cs (1)
399if (convertedExpression.ConstantValueOpt == null && convertedExpression.Kind == BoundKind.Conversion &&