139 references to Viable
Microsoft.CodeAnalysis.CSharp (138)
Binder\Binder.ValueChecks.cs (1)
879Debug.Assert(methodGroup.ResultKind != LookupResultKind.Viable);
Binder\Binder_Attributes.cs (3)
169LookupResultKind resultKind = LookupResultKind.Viable; 281hasErrors: resultKind != LookupResultKind.Viable); 549Debug.Assert(resultKind == LookupResultKind.Viable || wasError);
Binder\Binder_Await.cs (2)
394resultKind: LookupResultKind.Viable, 535resultKind: LookupResultKind.Viable,
Binder\Binder_Conversions.cs (1)
1413if (resolution.ResultKind != LookupResultKind.Viable)
Binder\Binder_Crefs.cs (1)
342if (result.Kind == LookupResultKind.Viable)
Binder\Binder_Deconstruct.cs (1)
958resultKind: LookupResultKind.Viable,
Binder\Binder_Expressions.cs (10)
221Debug.Assert(resultKind != LookupResultKind.Viable); 3358LookupResultKind.Viable, 5174resultKind: LookupResultKind.Viable, 5565sourceDelegate.DelegateInvokeMethod, null, BoundMethodGroupFlags.None, functionType: null, argument, LookupResultKind.Viable); 8170return BindPropertyAccess(syntax, receiver, propertySymbol, diagnostics, LookupResultKind.Viable, hasErrors: false); 8174return new BoundBadExpression(syntax, LookupResultKind.Viable, errorTypeSymbol.CandidateSymbols!, [AdjustBadExpressionChild(receiver)], CreateErrorType()); 8817result = new MethodGroupResolution(bestProperty, LookupResultKind.Viable, diagnostics.ToReadOnly()); 8989Debug.Assert(lookupResult.Kind == LookupResultKind.Viable); 10631method, lookupError: null, BoundMethodGroupFlags.None, functionType: null, receiver, LookupResultKind.Viable) 11174if (node.ResultKind == LookupResultKind.Viable)
Binder\Binder_InterpolatedString.cs (3)
549LookupResultKind.Viable, 733if (outConstructorCall is not BoundObjectCreationExpression { ResultKind: LookupResultKind.Viable }) 746if (nonOutConstructorCall is BoundObjectCreationExpression { ResultKind: LookupResultKind.Viable })
Binder\Binder_Invocation.cs (4)
743anyApplicableCandidates = resolution.ResultKind == LookupResultKind.Viable && resolution.OverloadResolutionResult.HasAnyApplicableMember; 799if (resolution.ResultKind != LookupResultKind.Viable) 1366argsToParamsOpt: argsToParams, defaultArguments, resultKind: LookupResultKind.Viable, type: returnType, hasErrors: gotError); 2583LookupResultKind.Viable,
Binder\Binder_Lookup.cs (5)
75if (result.Kind != LookupResultKind.Viable && result.Kind != LookupResultKind.Empty) 490if (res.Kind == LookupResultKind.Viable) 506if (res.Kind == LookupResultKind.Viable) 727if (result == null || result.Kind != LookupResultKind.Viable || (object)symbol == null) 1026result.MergeEqual(new SingleLookupResult(LookupResultKind.Viable, sym, null));
Binder\Binder_Operators.cs (25)
95LookupResultKind.Viable, 162Debug.Assert(resultKind is LookupResultKind.Viable or LookupResultKind.Ambiguous or LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty); 163Debug.Assert(best.HasValue == (resultKind is LookupResultKind.Viable)); 184Debug.Assert(instanceExtensionResult.ResultKind is LookupResultKind.Viable || !instanceExtensionResult.OriginalUserDefinedOperatorsOpt.IsDefaultOrEmpty); 525resultKind: LookupResultKind.Viable, 853resultKind: LookupResultKind.Viable, 1454resultKind: LookupResultKind.Viable, left, right, type: left.Type, hasErrors: constantValue != null && constantValue.IsBad); 2069Debug.Assert(resultKind is LookupResultKind.Viable or LookupResultKind.Ambiguous or LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty); 2070Debug.Assert(possiblyBest.HasValue == (resultKind is LookupResultKind.Viable)); 2179Debug.Assert(resultKind is LookupResultKind.Viable or LookupResultKind.Ambiguous or LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty); 2180Debug.Assert(possiblyBest.HasValue == (resultKind is LookupResultKind.Viable)); 2205resultKind = LookupResultKind.Viable; 2219resultKind = possiblyBest.HasValue ? LookupResultKind.Viable : LookupResultKind.Empty; 2275Debug.Assert(resultKind is LookupResultKind.Viable or LookupResultKind.Ambiguous or LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty); 2276Debug.Assert(best.HasValue == (resultKind is LookupResultKind.Viable)); 2324Debug.Assert(resultKind is LookupResultKind.Viable or LookupResultKind.Ambiguous or LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty); 2325Debug.Assert(possiblyBest.HasValue == (resultKind is LookupResultKind.Viable)); 2357resultKind = LookupResultKind.Viable; 2387resultKind = possiblyBest.HasValue ? LookupResultKind.Viable : LookupResultKind.Empty; 3298resultKind: LookupResultKind.Viable, 3328Debug.Assert(resultKind is LookupResultKind.Viable or LookupResultKind.Ambiguous or LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty); 3329Debug.Assert(best.HasValue == (resultKind is LookupResultKind.Viable)); 3351Debug.Assert(instanceExtensionResult.ResultKind is LookupResultKind.Viable || !instanceExtensionResult.OriginalUserDefinedOperatorsOpt.IsDefaultOrEmpty); 3611LookupResultKind.Viable, 4362resultKind: LookupResultKind.Viable,
Binder\Binder_Patterns.cs (1)
378lengthAccess = new BoundPropertyAccess(node, receiverPlaceholder, initialBindingReceiverIsSubjectToCloning: ThreeState.False, lengthProperty, autoPropertyAccessorKind: AccessorKind.Unknown, LookupResultKind.Viable, lengthProperty.Type) { WasCompilerGenerated = true };
Binder\Binder_Statements.cs (3)
2708LookupResultKind.Viable, 3967LookupResultKind resultKind = LookupResultKind.Viable; 4067resultKind: LookupResultKind.Viable,
Binder\Binder_Symbols.cs (1)
230case LookupResultKind.Viable:
Binder\LookupResult.cs (4)
140return Kind == LookupResultKind.Viable; 151return Kind == LookupResultKind.Viable && _symbolList.Count == 1; 157return new SingleLookupResult(LookupResultKind.Viable, symbol, null); 266else if (Kind != LookupResultKind.Viable)
Binder\LookupResultKind.cs (1)
93case LookupResultKind.Viable:
Binder\MethodGroupResolution.cs (2)
78(this.ResultKind == LookupResultKind.Viable) && 94bool isExtensionMember = ResultKind == LookupResultKind.Viable && MethodGroup is null;
Binder\Semantics\Conversions\Conversion.cs (2)
1053return LookupResultKind.Viable; 1061return this.Kind == ConversionKind.NoConversion ? LookupResultKind.Empty : LookupResultKind.Viable;
Binder\Semantics\Conversions\Conversions.cs (1)
373resolution.ResultKind == LookupResultKind.Viable)
Binder\Semantics\OverloadResolution\MethodGroup.cs (3)
33LookupResultKind resultKind = LookupResultKind.Viable, 44LookupResultKind resultKind = LookupResultKind.Viable, 69LookupResultKind resultKind = LookupResultKind.Viable,
Binder\WithUsingNamespacesAndTypesBinder.cs (1)
196if (res.Kind == LookupResultKind.Viable)
BoundTree\BoundCall.cs (2)
11public bool IsErroneousNode => ResultKind is not LookupResultKind.Viable; 17Debug.Assert(ResultKind is LookupResultKind.Viable || HasErrors);
BoundTree\BoundExpression.cs (2)
122return LookupResultKind.Viable; 283return LookupResultKind.Viable;
BoundTree\Constructors.cs (3)
20: this(syntax, receiver, fieldSymbol, constantValueOpt, LookupResultKind.Viable, fieldSymbol.Type, hasErrors) 143Debug.Assert(resultKind is not LookupResultKind.Viable); 230resultKind: LookupResultKind.Viable,
BoundTree\VariablePendingInference.cs (1)
104LookupResultKind.Viable,
Compilation\CSharpSemanticModel.cs (16)
1976if (resultKind == LookupResultKind.Viable && symbols.Count > 1) 3350resultKind = LookupResultKind.Viable; 3512case BoundKind.EventAccess when boundNodeForSyntacticParent is BoundEventAssignmentOperator { ResultKind: LookupResultKind.Viable } parentOperator && 3593Debug.Assert(resultKind != LookupResultKind.Viable); 3770resultKind = LookupResultKind.Viable; 3803if (operandType == 0 || operandType == UnaryOperatorKind.UserDefined || unaryOperator.ResultKind != LookupResultKind.Viable) 3826if (operandType == 0 || operandType == UnaryOperatorKind.UserDefined || increment.ResultKind != LookupResultKind.Viable) 3851if (operandType == 0 || operandType == BinaryOperatorKind.UserDefined || binaryOperator.ResultKind != LookupResultKind.Viable || binaryOperator.OperatorKind.IsLogical()) 3924if (operandType == 0 || operandType == BinaryOperatorKind.UserDefined || compoundAssignment.ResultKind != LookupResultKind.Viable) 3992Debug.Assert(resultKind != LookupResultKind.Viable || 4053Debug.Assert(resultKind != LookupResultKind.Viable); 4070Debug.Assert(resultKind != LookupResultKind.Viable); 4252resultKind = LookupResultKind.Viable; 4277resultKind = LookupResultKind.Viable; 4404resultKind = LookupResultKind.Viable; 4426resultKind = LookupResultKind.Viable;
Compilation\SymbolInfoFactory.cs (1)
36else if (resultKind == LookupResultKind.Viable)
Compilation\SyntaxTreeSemanticModel.cs (1)
267result = SymbolInfoFactory.Create(symbols, LookupResultKind.Viable, isDynamic: false);
Compiler\MethodBodySynthesizer.cs (2)
56resultKind: LookupResultKind.Viable, 506resultKind: LookupResultKind.Viable,
Lowering\LocalRewriter\LocalRewriter.cs (1)
322var result = new BoundFieldAccess(node.Syntax, new BoundThisReference(node.Syntax, primaryCtor.ContainingType), field, ConstantValue.NotAvailable, LookupResultKind.Viable, node.Type);
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (2)
145BoundExpression access = _localRewriter.MakeFieldAccess(f.Syntax, input, field, null, LookupResultKind.Viable, field.Type); 157return _factory.AssignmentExpression(output, _localRewriter.MakePropertyAccess(_factory.Syntax, input, property, LookupResultKind.Viable, property.Type, isLeftOfAssignment: false));
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (6)
542new BoundBinaryOperator(syntax, operatorKind, constantValueOpt: null, methodOpt: null, constrainedToTypeOpt: null, LookupResultKind.Viable, loweredLeft, loweredRight, type); 757return new BoundUnaryOperator(syntax, UnaryOperatorKind.BoolLogicalNegation, converted, ConstantValue.NotAvailable, MethodSymbol.None, constrainedToTypeOpt: null, LookupResultKind.Viable, boolean) 2009new BoundUnaryOperator(syntax, UnaryOperatorKind.BoolLogicalNegation, call, ConstantValue.NotAvailable, null, constrainedToTypeOpt: null, LookupResultKind.Viable, returnType); 2179LookupResultKind.Viable, 2192LookupResultKind.Viable, 2304LookupResultKind.Viable,
Lowering\LocalRewriter\LocalRewriter_Call.cs (2)
549resultKind: LookupResultKind.Viable, 1532resultKind: LookupResultKind.Viable,
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (1)
568resultKind: LookupResultKind.Viable,
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (5)
462resultKind: LookupResultKind.Viable, 665resultKind: LookupResultKind.Viable, 961resultKind: LookupResultKind.Viable, 1165resultKind: LookupResultKind.Viable, 1261resultKind: LookupResultKind.Viable,
Lowering\LocalRewriter\LocalRewriter_ObjectCreationExpression.cs (1)
363resultKind: LookupResultKind.Viable,
Lowering\LocalRewriter\LocalRewriter_PropertyAccess.cs (2)
86oldNodeOpt.Update(rewrittenReceiver, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, property, autoPropertyAccessorKind: AccessorKind.Unknown, LookupResultKind.Viable, property.Type) : 87new BoundPropertyAccess(syntax, rewrittenReceiver, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, property, autoPropertyAccessorKind: AccessorKind.Unknown, LookupResultKind.Viable, property.Type);
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (2)
159LookupResultKind.Viable, 176new BoundUnaryOperator(syntax, kind, loweredOperand, null, methodOpt: method, constrainedToTypeOpt: constrainedToTypeOpt, LookupResultKind.Viable, type);
Lowering\LocalRewriter\LocalRewriter_UsingStatement.cs (1)
534return MakeCall(null, syntax, expression, method, rewrittenArguments, argumentRefKindsOpt, LookupResultKind.Viable, temps.ToImmutableAndFree());
Lowering\SyntheticBoundNodeFactory.cs (6)
251return new BoundFieldAccess(Syntax, receiver, f, ConstantValue.NotAvailable, LookupResultKind.Viable, f.Type) { WasCompilerGenerated = true }; 645return new BoundBinaryOperator(this.Syntax, kind, ConstantValue.NotAvailable, methodOpt: null, constrainedToTypeOpt: null, LookupResultKind.Viable, left, right, type) { WasCompilerGenerated = true }; 883invokedAsExtensionMethod: false, argsToParamsOpt: default(ImmutableArray<int>), defaultArguments: default(BitVector), resultKind: LookupResultKind.Viable, 924argsToParamsOpt: ImmutableArray<int>.Empty, defaultArguments: default(BitVector), resultKind: LookupResultKind.Viable, type: method.ReturnType) 1637return new BoundUnaryOperator(expression.Syntax, UnaryOperatorKind.BoolLogicalNegation, expression, null, null, constrainedToTypeOpt: null, LookupResultKind.Viable, expression.Type); 1884new BoundUnaryOperator(syntax, UnaryOperatorKind.BoolLogicalNegation, call, ConstantValue.NotAvailable, methodOpt: null, constrainedToTypeOpt: null, LookupResultKind.Viable, returnType);
Operations\CSharpOperationFactory.cs (1)
478if (boundFunctionPointerInvocation.ResultKind != LookupResultKind.Viable)
Symbols\ErrorTypeSymbol.cs (1)
73Debug.Assert(ResultKind != LookupResultKind.Viable, "Shouldn't have viable result kind on error symbol");
Symbols\ExtendedErrorTypeSymbol.cs (1)
79Debug.Assert(candidateSymbols.IsEmpty || resultKind != LookupResultKind.Viable, "Shouldn't use LookupResultKind.Viable with candidate symbols");
Symbols\Synthesized\SynthesizedEntryPointSymbol.cs (3)
308resultKind: LookupResultKind.Viable, 374resultKind: LookupResultKind.Viable, 400resultKind: LookupResultKind.Viable,
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
DocumentationComments\CrefTests.cs (1)
5529Assert.Equal(LookupResultKind.Viable, lookupResult.Kind);