591 references to LookupResultKind
Microsoft.CodeAnalysis.CSharp (587)
Binder\Binder.ValueChecks.cs (4)
861Debug.Assert(methodGroup.ResultKind != LookupResultKind.Viable); 891var resultKind = (valueKind == BindValueKind.RValue || valueKind == BindValueKind.RValueOrMethodGroup) ? 892LookupResultKind.NotAValue : 893LookupResultKind.NotAVariable;
Binder\Binder.WithQueryLambdaParametersBinder.cs (1)
87LookupResultKind.Empty,
Binder\Binder_Attributes.cs (11)
169LookupResultKind resultKind = LookupResultKind.Viable; 229LookupResultKind.Inaccessible : 230LookupResultKind.OverloadResolutionFailure); 281hasErrors: resultKind != LookupResultKind.Viable); 523var badLHS = BadExpression(nameSyntax, lookupResultKind: LookupResultKind.Empty); 529LookupResultKind resultKind; 549Debug.Assert(resultKind == LookupResultKind.Viable || wasError); 594private Symbol BindNamedAttributeArgumentName(AttributeArgumentSyntax namedArgument, NamedTypeSymbol attributeType, BindingDiagnosticBag diagnostics, out bool wasError, out LookupResultKind resultKind) 663LookupResultKind.NotAVariable, 676LookupResultKind.NotAVariable,
Binder\Binder_Await.cs (2)
382resultKind: LookupResultKind.Viable, 523resultKind: LookupResultKind.Viable,
Binder\Binder_Conversions.cs (1)
1391if (resolution.ResultKind != LookupResultKind.Viable)
Binder\Binder_Crefs.cs (1)
342if (result.Kind == LookupResultKind.Viable)
Binder\Binder_Deconstruct.cs (1)
956resultKind: LookupResultKind.Viable,
Binder\Binder_Expressions.cs (79)
114return BadExpression(syntax, LookupResultKind.Empty, ImmutableArray<Symbol>.Empty); 122return BadExpression(syntax, LookupResultKind.Empty, ImmutableArray<Symbol>.Empty, childNode); 130return BadExpression(syntax, LookupResultKind.Empty, ImmutableArray<Symbol>.Empty, childNodes); 136protected BoundBadExpression BadExpression(SyntaxNode syntax, LookupResultKind lookupResultKind) 144protected BoundBadExpression BadExpression(SyntaxNode syntax, LookupResultKind lookupResultKind, BoundExpression childNode) 152private BoundBadExpression BadExpression(SyntaxNode syntax, LookupResultKind resultKind, ImmutableArray<Symbol> symbols) 165private BoundBadExpression BadExpression(SyntaxNode syntax, LookupResultKind resultKind, ImmutableArray<Symbol> symbols, BoundExpression childNode) 178private BoundBadExpression BadExpression(SyntaxNode syntax, LookupResultKind resultKind, ImmutableArray<Symbol> symbols, ImmutableArray<BoundExpression> childNodes, bool wasCompilerGenerated = false) 200private BoundExpression ToBadExpression(BoundExpression expr, LookupResultKind resultKind = LookupResultKind.Empty) 203Debug.Assert(resultKind != LookupResultKind.Viable); 584return BadExpression(node, LookupResultKind.NotAValue); 591return BadExpression(node, LookupResultKind.NotAValue); 862node, LookupResultKind.Empty, ImmutableArray<Symbol>.Empty, ImmutableArray.Create<BoundExpression>(BindToTypeForErrorRecovery(BindValue(node.Expression, BindingDiagnosticBag.Discarded, BindValueKind.RefersToLocation))), 1049argumentSyntax, LookupResultKind.Empty, ImmutableArray<Symbol>.Empty, 1498bool result = lookupResult.Kind != LookupResultKind.Empty; 1660if (lookupResult.Kind != LookupResultKind.Empty) 1704resultKind: LookupResultKind.WrongArity, 1832if (lookupResult.Kind != LookupResultKind.Empty) 2012private BoundExpression BindNonMethod(SimpleNameSyntax node, Symbol symbol, BindingDiagnosticBag diagnostics, LookupResultKind resultKind, bool indexed, bool isError) 2465return BadExpression(node, LookupResultKind.NotLabel); 2824if (conversion.ResultKind == LookupResultKind.OverloadResolutionFailure) 3308LookupResultKind.Viable, 4269LookupResultKind.Empty, 4538LookupResultKind.NotCreatable, //in this context, anyway 4577LookupResultKind.Empty, 4909resultKind: LookupResultKind.Empty, 4920resultKind: LookupResultKind.Empty, 4963resultKind: LookupResultKind.Empty, 5120resultKind: LookupResultKind.Viable, 5132resultKind: LookupResultKind.OverloadResolutionFailure, 5256type = new ExtendedErrorTypeSymbol(type, LookupResultKind.NotCreatable, 5266type = new ExtendedErrorTypeSymbol(type, LookupResultKind.NotCreatable, 5284return new BoundBadExpression(syntax, LookupResultKind.Empty, ImmutableArray<Symbol?>.Empty, ImmutableArray<BoundExpression>.Empty, CreateErrorType()); 5499return new BoundBadExpression(node, LookupResultKind.NotInvocable, StaticCast<Symbol>.From(type.InstanceConstructors), ImmutableArray.Create(argument), type); 5510sourceDelegate.DelegateInvokeMethod, null, BoundMethodGroupFlags.None, functionType: null, argument, LookupResultKind.Viable); 5546return new BoundBadExpression(node, LookupResultKind.OverloadResolutionFailure, StaticCast<Symbol>.From(type.InstanceConstructors), childNodes, type); 5643return new BoundBadExpression(node, LookupResultKind.NotCreatable, ImmutableArray.Create<Symbol?>(type), children.ToImmutableAndFree(), type) { WasCompilerGenerated = wasCompilerGenerated }; 5811LookupResultKind.Empty, 5831return BindToTypeForErrorRecovery(ToBadExpression(boundExpression, LookupResultKind.NotAValue)); 5869LookupResultKind resultKind; 5972resultKind = LookupResultKind.NotAValue; 6058resultKind = isRhsNestedInitializer ? LookupResultKind.NotAValue : LookupResultKind.NotAVariable; 6083ref LookupResultKind resultKind) 6095resultKind = LookupResultKind.NotAValue; 6125case LookupResultKind.Empty: 6129case LookupResultKind.Inaccessible: 6140return ToBadExpression(boundMember, (valueKind == BindValueKind.RValue) ? LookupResultKind.NotAValue : LookupResultKind.NotAVariable); 6438return BadExpression(elementInitializer, LookupResultKind.NotInvocable); 6479return BadExpression(elementInitializer, LookupResultKind.NotInvocable, ImmutableArray<Symbol>.Empty, boundElementInitializerExpressions); 6913LookupResultKind resultKind; 6918resultKind = LookupResultKind.NotCreatable; 6922resultKind = LookupResultKind.Inaccessible; 6926resultKind = LookupResultKind.OverloadResolutionFailure; 7111return new BoundBadExpression(node, LookupResultKind.OverloadResolutionFailure, ImmutableArray<Symbol>.Empty, children, interfaceType); 7868return new BoundBadExpression(node, LookupResultKind.Ambiguous, lookupResult.Symbols.AsImmutable(), ImmutableArray.Create(boundLeft), CreateErrorType(rightName), hasErrors: true); 7889else if (lookupResult.Kind == LookupResultKind.WrongArity) 7899else if (lookupResult.Kind == LookupResultKind.Empty) 7942return BadExpression(node, LookupResultKind.NotAValue, boundLeft); 8086return BindPropertyAccess(syntax, receiver, propertySymbol, diagnostics, LookupResultKind.Viable, hasErrors: false); 8090return new BoundBadExpression(syntax, LookupResultKind.Viable, errorTypeSymbol.CandidateSymbols!, [receiver], CreateErrorType()); 8317LookupResultKind lookupKind) 8731result = new MethodGroupResolution(bestProperty, LookupResultKind.Viable, diagnostics.ToReadOnly()); 8870var resultSymbol = new ExtendedErrorTypeSymbol(containingSymbol: null, lookupResult.Symbols.ToImmutable(), LookupResultKind.OverloadResolutionFailure, errorInfo, arity); 8871return new MethodGroupResolution(resultSymbol, LookupResultKind.Viable, diagnostics.ToReadOnly()); 8888LookupResultKind resultKind, 9048LookupResultKind lookupResult, 9128LookupResultKind lookupResult, 9173ref LookupResultKind resultKind, 9193resultKind = LookupResultKind.StaticInstanceMismatch; 9202resultKind = LookupResultKind.StaticInstanceMismatch; 9227Debug.Assert(result.Kind != LookupResultKind.Empty); 9640return new BoundBadExpression(node, LookupResultKind.Empty, ImmutableArray<Symbol>.Empty, childBoundNodes, CreateErrorType(), hasErrors: true); 10492method, lookupError: null, BoundMethodGroupFlags.None, functionType: null, receiver, LookupResultKind.Viable) 10719LookupResultKind methodResultKind = methodResolution.ResultKind; 10720LookupResultKind extensionMethodResultKind = extensionMethodResolution.ResultKind; 11034if (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 (12)
122return BadExpression(node, LookupResultKind.Empty, ImmutableArray.Create(symbol), args.Add(receiver), wasCompilerGenerated: true); 151result = CreateBadCall(node, boundExpression, LookupResultKind.NotInvocable, analyzedArguments); 373return CreateBadCall(node, boundExpression, LookupResultKind.NotInvocable, analyzedArguments); 390result = CreateBadCall(node, boundExpression, LookupResultKind.NotInvocable, analyzedArguments); 743anyApplicableCandidates = resolution.ResultKind == LookupResultKind.Viable && resolution.OverloadResolutionResult.HasAnyApplicableMember; 750LookupResultKind resultKind; 798if (resolution.ResultKind != LookupResultKind.Viable) 1382argsToParamsOpt: argsToParams, defaultArguments, resultKind: LookupResultKind.Viable, type: returnType, hasErrors: gotError); 2050LookupResultKind resultKind, 2327LookupResultKind resultKind, 2563LookupResultKind.OverloadResolutionFailure, 2582LookupResultKind.Viable,
Binder\Binder_Lookup.cs (7)
75if (result.Kind != LookupResultKind.Viable && result.Kind != LookupResultKind.Empty) 291if (errorType.ResultKind == LookupResultKind.Inaccessible) 481if (res.Kind == LookupResultKind.Viable) 497if (res.Kind == LookupResultKind.Viable) 718if (result == null || result.Kind != LookupResultKind.Viable || (object)symbol == null) 1017result.MergeEqual(new SingleLookupResult(LookupResultKind.Viable, sym, null));
Binder\Binder_Operators.cs (121)
55leftPlaceholder: null, leftConversion: null, finalPlaceholder: null, finalConversion: null, LookupResultKind.Empty, CreateErrorType(), hasErrors: true); 88LookupResultKind.Viable, 100leftPlaceholder: null, leftConversion: null, finalPlaceholder: null, finalConversion: null, LookupResultKind.Empty, CreateErrorType(), hasErrors: true); 114leftPlaceholder: null, leftConversion: null, finalPlaceholder: null, finalConversion: null, LookupResultKind.NotAVariable, CreateErrorType(), hasErrors: true); 119return createBadCompoundAssignmentOperator(node, kind, left, right, LookupResultKind.OverloadResolutionFailure, default(ImmutableArray<MethodSymbol>), diagnostics); 148LookupResultKind resultKind; 154Debug.Assert(resultKind is LookupResultKind.Viable or LookupResultKind.Ambiguous or LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty); 155Debug.Assert(best.HasValue == (resultKind is LookupResultKind.Viable)); 156Debug.Assert(resultKind is not (LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty) || originalUserDefinedOperators.IsEmpty); 158if (!best.HasValue && resultKind != LookupResultKind.Ambiguous) 160Debug.Assert(resultKind is LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty); 163LookupResultKind staticExtensionResultKind; 175Debug.Assert(instanceExtensionResult.ResultKind is LookupResultKind.Viable || !instanceExtensionResult.OriginalUserDefinedOperatorsOpt.IsDefaultOrEmpty); 320LookupResultKind resultKind, 512resultKind: LookupResultKind.Viable, 533resultKind: LookupResultKind.OverloadResolutionFailure, 568out LookupResultKind staticResultKind, 572staticResultKind = LookupResultKind.Empty; 824resultKind: LookupResultKind.Viable, 924return new BoundBinaryOperator(node, kind, ConstantValue.NotAvailable, methodOpt: null, constrainedToTypeOpt: null, LookupResultKind.Empty, left, right, GetBinaryOperatorErrorType(kind, diagnostics, node), true); 965return new BoundBinaryOperator(node, BinaryOperatorKind.StringConcatenation, BoundBinaryOperator.UncommonData.UnconvertedInterpolatedStringAddition(stringConstant), LookupResultKind.Empty, left, right, right.Type); 983LookupResultKind resultKind; 1106out LookupResultKind resultKind, out ImmutableArray<MethodSymbol> originalUserDefinedOperators, 1111resultKind = LookupResultKind.OverloadResolutionFailure; 1130ref LookupResultKind resultKind, 1194LookupResultKind extensionResultKind; 1257private static void ReportUnaryOperatorError(CSharpSyntaxNode node, BindingDiagnosticBag diagnostics, string operatorName, BoundExpression operand, LookupResultKind resultKind) 1265ErrorCode errorCode = resultKind == LookupResultKind.Ambiguous ? 1272private void ReportAssignmentOperatorError(AssignmentExpressionSyntax node, BinaryOperatorKind kind, BindingDiagnosticBag diagnostics, BoundExpression left, BoundExpression right, LookupResultKind resultKind) 1291private void ReportBinaryOperatorError(ExpressionSyntax node, BindingDiagnosticBag diagnostics, SyntaxToken operatorToken, BoundExpression left, BoundExpression right, LookupResultKind resultKind) 1325case LookupResultKind.Ambiguous: 1329case LookupResultKind.OverloadResolutionFailure when operatorToken.Kind() is SyntaxKind.PlusToken && isReadOnlySpanOfByte(left.Type) && isReadOnlySpanOfByte(right.Type): 1403resultKind: LookupResultKind.Viable, left, right, type: left.Type, hasErrors: constantValue != null && constantValue.IsBad); 1413resultKind: LookupResultKind.Empty, left, right, type: GetBinaryOperatorErrorType(kind, diagnostics, node), hasErrors: true); 1423LookupResultKind lookupResult; 1429lookupResult = LookupResultKind.OverloadResolutionFailure; 1971out LookupResultKind resultKind, 1988out LookupResultKind resultKind, 1993Debug.Assert(resultKind is LookupResultKind.Viable or LookupResultKind.Ambiguous or LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty); 1994Debug.Assert(possiblyBest.HasValue == (resultKind is LookupResultKind.Viable)); 1995Debug.Assert(resultKind is not (LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty) || originalUserDefinedOperators.IsEmpty); 1997if (!possiblyBest.HasValue && resultKind != LookupResultKind.Ambiguous) 1999Debug.Assert(resultKind is LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty); 2002LookupResultKind extensionResultKind; 2028out LookupResultKind resultKind, 2031resultKind = LookupResultKind.Empty; 2076out LookupResultKind resultKind, 2087Debug.Assert(resultKind is LookupResultKind.Viable or LookupResultKind.Ambiguous or LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty); 2088Debug.Assert(possiblyBest.HasValue == (resultKind is LookupResultKind.Viable)); 2089Debug.Assert(resultKind is not (LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty) || originalUserDefinedOperators.IsEmpty); 2094private static BinaryOperatorAnalysisResult BinaryOperatorAnalyzeOverloadResolutionResult(BinaryOperatorOverloadResolutionResult result, out LookupResultKind resultKind, out ImmutableArray<MethodSymbol> originalUserDefinedOperators) 2113resultKind = LookupResultKind.Viable; 2117resultKind = LookupResultKind.Ambiguous; 2121resultKind = LookupResultKind.OverloadResolutionFailure; 2127resultKind = possiblyBest.HasValue ? LookupResultKind.Viable : LookupResultKind.Empty; 2174out LookupResultKind resultKind, 2182Debug.Assert(resultKind is LookupResultKind.Viable or LookupResultKind.Ambiguous or LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty); 2183Debug.Assert(best.HasValue == (resultKind is LookupResultKind.Viable)); 2184Debug.Assert(resultKind is not (LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty) || originalUserDefinedOperators.IsEmpty); 2186if (!best.HasValue && resultKind != LookupResultKind.Ambiguous) 2188Debug.Assert(resultKind is LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty); 2191LookupResultKind extensionResultKind; 2214out LookupResultKind resultKind, 2226Debug.Assert(resultKind is LookupResultKind.Viable or LookupResultKind.Ambiguous or LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty); 2227Debug.Assert(possiblyBest.HasValue == (resultKind is LookupResultKind.Viable)); 2228Debug.Assert(resultKind is not (LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty) || originalUserDefinedOperators.IsEmpty); 2239out LookupResultKind resultKind, 2259resultKind = LookupResultKind.Viable; 2274resultKind = LookupResultKind.OverloadResolutionFailure; 2278resultKind = LookupResultKind.Ambiguous; 2283resultKind = LookupResultKind.OverloadResolutionFailure; 2289resultKind = possiblyBest.HasValue ? LookupResultKind.Viable : LookupResultKind.Empty; 2317out LookupResultKind resultKind, 2320resultKind = LookupResultKind.Empty; 3160LookupResultKind.Empty, 3181resultKind: LookupResultKind.Viable, 3205LookupResultKind resultKind; 3209Debug.Assert(resultKind is LookupResultKind.Viable or LookupResultKind.Ambiguous or LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty); 3210Debug.Assert(best.HasValue == (resultKind is LookupResultKind.Viable)); 3211Debug.Assert(resultKind is not (LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty) || originalUserDefinedOperators.IsEmpty); 3213if (!best.HasValue && resultKind != LookupResultKind.Ambiguous) 3215Debug.Assert(resultKind is LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty); 3219LookupResultKind staticExtensionResultKind; 3231Debug.Assert(instanceExtensionResult.ResultKind is LookupResultKind.Viable || !instanceExtensionResult.OriginalUserDefinedOperatorsOpt.IsDefaultOrEmpty); 3488LookupResultKind.Viable, 3513LookupResultKind.OverloadResolutionFailure, 3547out LookupResultKind staticResultKind, 3553staticResultKind = LookupResultKind.Empty; 4201resultKind: LookupResultKind.Empty, 4222resultKind: LookupResultKind.Viable, 4226LookupResultKind resultKind;
Binder\Binder_Patterns.cs (4)
367lengthAccess = new BoundPropertyAccess(node, receiverPlaceholder, initialBindingReceiverIsSubjectToCloning: ThreeState.False, lengthProperty, autoPropertyAccessorKind: AccessorKind.Unknown, LookupResultKind.Viable, lengthProperty.Type) { WasCompilerGenerated = true }; 371lengthAccess = new BoundBadExpression(node, LookupResultKind.Empty, ImmutableArray<Symbol?>.Empty, ImmutableArray<BoundExpression>.Empty, CreateErrorType(), hasErrors: true) { WasCompilerGenerated = true }; 1584case LookupResultKind.Empty: 1588case LookupResultKind.Inaccessible:
Binder\Binder_Query.cs (6)
302state.selectOrGroup, LookupResultKind.OverloadResolutionFailure, ImmutableArray<Symbol?>.Empty, 747yExpression = new BoundBadExpression(yExpression.Syntax, LookupResultKind.Empty, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create(yExpression), CreateErrorType()); 753yExpression = new BoundBadExpression(yExpression.Syntax, LookupResultKind.Empty, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create(yExpression), yExpression.Type); 814field2Value = new BoundBadExpression(field2Value.Syntax, LookupResultKind.Empty, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create(field2Value), field2Value.Type, true); 970receiver = new BoundBadExpression(receiver.Syntax, LookupResultKind.NotAValue, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create(receiver), CreateErrorType()); 992receiver = new BoundBadExpression(receiver.Syntax, LookupResultKind.NotAValue, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create(receiver), CreateErrorType());
Binder\Binder_Statements.cs (8)
2305else if (conversion.ResultKind == LookupResultKind.OverloadResolutionFailure) 2701LookupResultKind.Viable, 2745var best = this.UnaryOperatorOverloadResolution(UnaryOperatorKind.True, expr, node, diagnostics, out LookupResultKind resultKind, out ImmutableArray<MethodSymbol> originalUserDefinedOperators); 3955LookupResultKind resultKind = LookupResultKind.Viable; 3985resultKind = LookupResultKind.Inaccessible; 4051resultKind: LookupResultKind.Viable, 4189if (call.ResultKind == LookupResultKind.Empty)
Binder\Binder_Symbols.cs (11)
222case LookupResultKind.Empty: 228case LookupResultKind.Viable: 341return TypeWithAnnotations.Create(new ExtendedErrorTypeSymbol(GetContainingNamespaceOrNonExtensionType(symbol.Symbol), symbol.Symbol, LookupResultKind.NotATypeOrNamespace, diagnosticInfo)); 592return TypeWithAnnotations.Create(new ExtendedErrorTypeSymbol(left, LookupResultKind.NotATypeOrNamespace, diagnostics.Add(ErrorCode.ERR_ColColWithTypeAlias, node.Alias.Location, node.Alias.Identifier.Text))); 1507receiver = new BoundBadExpression(receiver.Syntax, LookupResultKind.Ambiguous, ImmutableArray<Symbol>.Empty, ImmutableArray.Create(receiver), receiver.Type, hasErrors: true).MakeCompilerGenerated(); 1517receiver = new BoundBadExpression(receiver.Syntax, LookupResultKind.Empty, ImmutableArray<Symbol>.Empty, childBoundNodes: [receiver], receiver.Type, hasErrors: true).MakeCompilerGenerated(); 2287LookupResultKind.Ambiguous, 2303singleResult = new ExtendedErrorTypeSymbol(GetContainingNamespaceOrNonExtensionType(singleResult), singleResult, LookupResultKind.NotReferencable, errorInfo); // UNDONE: Review resultkind. 2349if (result.Kind == LookupResultKind.Empty) 2387result.Kind == LookupResultKind.NotATypeOrNamespace || result.Kind == LookupResultKind.NotAnAttributeType)
Binder\Binder_TupleOperators.cs (2)
158LookupResultKind resultKind; 211ReportBinaryOperatorError(node, diagnostics, node.OperatorToken, left, right, LookupResultKind.Ambiguous);
Binder\Binder_XmlNameAttribute.cs (1)
33if (lookupResult.Kind == LookupResultKind.Empty)
Binder\ForEachLoopBinder.cs (2)
742LookupResultKind.Empty, 951if (collectionExpr.ResultKind == LookupResultKind.NotAValue)
Binder\LookupResult.cs (19)
65private LookupResultKind _kind; 78_kind = LookupResultKind.Empty; 87return _kind == LookupResultKind.Empty && _error == null && _symbolList.Count == 0; 93_kind = LookupResultKind.Empty; 98internal LookupResultKind Kind 140return Kind == LookupResultKind.Viable; 151return Kind == LookupResultKind.Viable && _symbolList.Count == 1; 157return new SingleLookupResult(LookupResultKind.Viable, symbol, null); 162return new SingleLookupResult(LookupResultKind.WrongArity, symbol, error); 167return new SingleLookupResult(LookupResultKind.Empty, null, null); 172return new SingleLookupResult(LookupResultKind.NotReferencable, symbol, error); 177return new SingleLookupResult(LookupResultKind.StaticInstanceMismatch, symbol, error); 182return new SingleLookupResult(LookupResultKind.Inaccessible, symbol, error); 188return new SingleLookupResult(LookupResultKind.NotInvocable, symbol, diagInfo); 193return new SingleLookupResult(LookupResultKind.NotLabel, symbol, error); 198return new SingleLookupResult(LookupResultKind.NotATypeOrNamespace, symbol, error); 205return new SingleLookupResult(LookupResultKind.NotATypeOrNamespace, symbol, diagInfo); 210return new SingleLookupResult(LookupResultKind.NotAnAttributeType, symbol, error); 266else if (Kind != LookupResultKind.Viable)
Binder\LookupResultKind.cs (21)
74public static CandidateReason ToCandidateReason(this LookupResultKind resultKind) 78case LookupResultKind.Empty: return CandidateReason.None; 79case LookupResultKind.NotATypeOrNamespace: return CandidateReason.NotATypeOrNamespace; 80case LookupResultKind.NotAnAttributeType: return CandidateReason.NotAnAttributeType; 81case LookupResultKind.WrongArity: return CandidateReason.WrongArity; 82case LookupResultKind.Inaccessible: return CandidateReason.Inaccessible; 83case LookupResultKind.NotCreatable: return CandidateReason.NotCreatable; 84case LookupResultKind.NotReferencable: return CandidateReason.NotReferencable; 85case LookupResultKind.NotAValue: return CandidateReason.NotAValue; 86case LookupResultKind.NotAVariable: return CandidateReason.NotAVariable; 87case LookupResultKind.NotInvocable: return CandidateReason.NotInvocable; 88case LookupResultKind.StaticInstanceMismatch: return CandidateReason.StaticInstanceMismatch; 89case LookupResultKind.OverloadResolutionFailure: return CandidateReason.OverloadResolutionFailure; 90case LookupResultKind.Ambiguous: return CandidateReason.Ambiguous; 91case LookupResultKind.MemberGroup: return CandidateReason.MemberGroup; 93case LookupResultKind.Viable: 103public static LookupResultKind WorseResultKind(this LookupResultKind resultKind1, LookupResultKind resultKind2) 105if (resultKind1 == LookupResultKind.Empty) 107if (resultKind2 == LookupResultKind.Empty)
Binder\MethodGroupResolution.cs (6)
26public readonly LookupResultKind ResultKind; 33public MethodGroupResolution(Symbol otherSymbol, LookupResultKind resultKind, ReadOnlyBindingDiagnostic<AssemblySymbol> diagnostics) 43LookupResultKind resultKind, 51Debug.Assert(resultKind != LookupResultKind.Ambiguous); // HasAnyApplicableMethod is expecting Viable methods. 78(this.ResultKind == LookupResultKind.Viable) && 94bool isExtensionMember = ResultKind == LookupResultKind.Viable && MethodGroup is null;
Binder\Semantics\Conversions\Conversion.cs (6)
1044internal LookupResultKind ResultKind 1053return LookupResultKind.Viable; 1057return LookupResultKind.OverloadResolutionFailure; 1061return this.Kind == ConversionKind.NoConversion ? LookupResultKind.Empty : LookupResultKind.Viable; 1068return LookupResultKind.OverloadResolutionFailure;
Binder\Semantics\Conversions\Conversions.cs (1)
373resolution.ResultKind == LookupResultKind.Viable)
Binder\Semantics\OverloadResolution\MethodGroup.cs (10)
22internal LookupResultKind ResultKind { get; private set; } 33LookupResultKind resultKind = LookupResultKind.Viable, 44LookupResultKind resultKind = LookupResultKind.Viable, 69LookupResultKind resultKind = LookupResultKind.Viable, 80private void PopulateHelper(BoundExpression receiverOpt, LookupResultKind resultKind, DiagnosticInfo error) 95this.ResultKind = LookupResultKind.Empty; 134Debug.Assert(this.ResultKind == LookupResultKind.Empty);
Binder\SingleLookupResult.cs (2)
22internal readonly LookupResultKind Kind; 30internal SingleLookupResult(LookupResultKind kind, Symbol symbol, DiagnosticInfo error)
Binder\SwitchBinder.cs (1)
446return new BoundBadExpression(node, LookupResultKind.Empty, ImmutableArray<Symbol>.Empty, ImmutableArray.Create(switchGoverningExpression), switchGoverningType ?? CreateErrorType());
Binder\WithUsingNamespacesAndTypesBinder.cs (1)
196if (res.Kind == LookupResultKind.Viable)
BoundTree\BoundCall.cs (4)
11public bool IsErroneousNode => ResultKind is not LookupResultKind.Viable; 15Debug.Assert(ResultKind is not LookupResultKind.MemberGroup); 16Debug.Assert(ResultKind is not LookupResultKind.StaticInstanceMismatch); 17Debug.Assert(ResultKind is LookupResultKind.Viable || HasErrors);
BoundTree\BoundExpression.cs (6)
118public virtual LookupResultKind ResultKind 122return LookupResultKind.Viable; 275public override LookupResultKind ResultKind 283return LookupResultKind.Viable; 345public override LookupResultKind ResultKind 349return !this.OriginalIndexersOpt.IsDefault ? LookupResultKind.OverloadResolutionFailure : base.ResultKind;
BoundTree\Constructors.cs (20)
20: this(syntax, receiver, fieldSymbol, constantValueOpt, LookupResultKind.Viable, fieldSymbol.Type, hasErrors) 29LookupResultKind resultKind, 41LookupResultKind resultKind, 53LookupResultKind resultKind, 99LookupResultKind resultKind, 117LookupResultKind resultKind, 131LookupResultKind resultKind, 136resultKind = resultKind.WorseResultKind(LookupResultKind.OverloadResolutionFailure); 143Debug.Assert(resultKind is not LookupResultKind.Viable); 230resultKind: LookupResultKind.Viable, 415LookupResultKind resultKind, 436LookupResultKind resultKind, 449LookupResultKind resultKind, 535public BoundBadExpression(SyntaxNode syntax, LookupResultKind resultKind, ImmutableArray<Symbol?> symbols, ImmutableArray<BoundExpression> childBoundNodes, TypeSymbol type) 657LookupResultKind resultKind, 671LookupResultKind resultKind, 685LookupResultKind resultKind, 697LookupResultKind resultKind, 714LookupResultKind resultKind, 721public BoundIncrementOperator Update(UnaryOperatorKind operatorKind, BoundExpression operand, MethodSymbol? methodOpt, TypeSymbol? constrainedToTypeOpt, BoundValuePlaceholder? operandPlaceholder, BoundExpression? operandConversion, BoundValuePlaceholder? resultPlaceholder, BoundExpression? resultConversion, LookupResultKind resultKind, TypeSymbol type)
BoundTree\VariablePendingInference.cs (1)
104LookupResultKind.Viable,
Compilation\CSharpSemanticModel.cs (71)
383LookupResultKind resultKind = LookupResultKind.Ambiguous; 391resultKind = LookupResultKind.OverloadResolutionFailure; 1917boundExpr, boundNodeForSyntacticParent, binderOpt, options, out bool isDynamic, out LookupResultKind resultKind, out ImmutableArray<Symbol> unusedMemberGroup); 1921LookupResultKind highestResultKind; 1927if ((symbols.Count != 1 || resultKind == LookupResultKind.OverloadResolutionFailure) && highestSymbols.Count > 0) 1933else if (highestResultKind != LookupResultKind.Empty && highestResultKind < resultKind) 1959if (resultKind == LookupResultKind.Empty) 1963return SymbolInfoFactory.Create(ImmutableArray<Symbol>.Empty, LookupResultKind.Empty, isDynamic); 1983if (resultKind == LookupResultKind.Viable && symbols.Count > 1) 1985resultKind = LookupResultKind.OverloadResolutionFailure; 2294LookupResultKind resultKind; 2340LookupResultKind resultKind = originalErrorSymbol.ResultKind; 2341if (resultKind != LookupResultKind.Empty) 3361out LookupResultKind resultKind, 3366resultKind = LookupResultKind.Viable; 3387if (resultKind == LookupResultKind.NotCreatable) 3393resultKind = LookupResultKind.Empty; 3415((BoundBadExpression)boundNodeForSyntacticParent).ResultKind == LookupResultKind.NotCreatable) 3417resultKind = LookupResultKind.NotCreatable; 3518resultKind = LookupResultKind.Empty; 3527case BoundKind.EventAccess when boundNodeForSyntacticParent is BoundEventAssignmentOperator { ResultKind: LookupResultKind.Viable } parentOperator && 3608Debug.Assert(resultKind != LookupResultKind.Viable); 3687resultKind = resultKind.WorseResultKind(LookupResultKind.OverloadResolutionFailure); 3745private static ParameterSymbol GetThisParameter(TypeSymbol typeOfThis, NamedTypeSymbol containingType, Symbol containingMember, out LookupResultKind resultKind) 3750resultKind = LookupResultKind.NotReferencable; 3763resultKind = LookupResultKind.NotReferencable; 3769resultKind = LookupResultKind.StaticInstanceMismatch; 3778resultKind = LookupResultKind.NotReferencable; 3785resultKind = LookupResultKind.Viable; 3793resultKind = LookupResultKind.NotReferencable; 3806resultKind = LookupResultKind.NotReferencable; 3813private static void GetSymbolsAndResultKind(BoundUnaryOperator unaryOperator, out bool isDynamic, ref LookupResultKind resultKind, ref OneOrMany<Symbol> symbols) 3818if (operandType == 0 || operandType == UnaryOperatorKind.UserDefined || unaryOperator.ResultKind != LookupResultKind.Viable) 3836private static void GetSymbolsAndResultKind(BoundIncrementOperator increment, out bool isDynamic, ref LookupResultKind resultKind, ref OneOrMany<Symbol> symbols) 3841if (operandType == 0 || operandType == UnaryOperatorKind.UserDefined || increment.ResultKind != LookupResultKind.Viable) 3860private static void GetSymbolsAndResultKind(BoundBinaryOperator binaryOperator, out bool isDynamic, ref LookupResultKind resultKind, ref OneOrMany<Symbol> symbols) 3866if (operandType == 0 || operandType == BinaryOperatorKind.UserDefined || binaryOperator.ResultKind != LookupResultKind.Viable || binaryOperator.OperatorKind.IsLogical()) 3933private static void GetSymbolsAndResultKind(BoundCompoundAssignmentOperator compoundAssignment, out bool isDynamic, ref LookupResultKind resultKind, ref OneOrMany<Symbol> symbols) 3939if (operandType == 0 || operandType == BinaryOperatorKind.UserDefined || compoundAssignment.ResultKind != LookupResultKind.Viable) 3959private static void GetSymbolsAndResultKind(BoundExpression node, Symbol symbolOpt, ImmutableArray<MethodSymbol> originalCandidates, out OneOrMany<Symbol> symbols, out LookupResultKind resultKind) 3974resultKind = LookupResultKind.Empty; 3985ref LookupResultKind resultKind, 4007Debug.Assert(resultKind != LookupResultKind.Viable || 4038ref LookupResultKind resultKind, 4068Debug.Assert(resultKind != LookupResultKind.Viable); 4085Debug.Assert(resultKind != LookupResultKind.Viable); 4086resultKind = resultKind.WorseResultKind(LookupResultKind.OverloadResolutionFailure); 4256out LookupResultKind resultKind, 4265if (resultKind == LookupResultKind.Empty) 4267resultKind = LookupResultKind.Viable; 4292resultKind = LookupResultKind.Viable; 4296resultKind = call.ResultKind.WorseResultKind(LookupResultKind.OverloadResolutionFailure); 4363resultKind = resultKind.WorseResultKind(LookupResultKind.MemberGroup); 4370resultKind = resultKind.WorseResultKind(LookupResultKind.OverloadResolutionFailure); 4385resultKind = resultKind.WorseResultKind(LookupResultKind.OverloadResolutionFailure); 4395if (!isDynamic && resultKind > LookupResultKind.OverloadResolutionFailure) 4397resultKind = LookupResultKind.OverloadResolutionFailure; 4409out LookupResultKind resultKind, 4417if (resultKind == LookupResultKind.Empty) 4419resultKind = LookupResultKind.Viable; 4441resultKind = LookupResultKind.Viable; 4445resultKind = indexer.ResultKind.WorseResultKind(LookupResultKind.OverloadResolutionFailure); 4480if (resultKind > LookupResultKind.OverloadResolutionFailure) 4482resultKind = LookupResultKind.OverloadResolutionFailure; 4585var resultKind = LookupResultKind.Empty; 4721ref LookupResultKind resultKind, 4731LookupResultKind singleKind = singleResult.Kind; 4740resultKind = LookupResultKind.Empty; 4752Debug.Assert((members.Count == 0) == (resultKind == LookupResultKind.Empty));
Compilation\SymbolInfoFactory.cs (3)
20internal static SymbolInfo Create(ImmutableArray<Symbol> symbols, LookupResultKind resultKind, bool isDynamic) 23internal static SymbolInfo Create(OneOrMany<Symbol> symbols, LookupResultKind resultKind, bool isDynamic) 36else if (resultKind == LookupResultKind.Viable)
Compilation\SyntaxTreeSemanticModel.cs (2)
267result = SymbolInfoFactory.Create(symbols, LookupResultKind.Viable, isDynamic: false); 270result = SymbolInfoFactory.Create(symbols, LookupResultKind.Ambiguous, isDynamic: false);
Compiler\MethodBodySynthesizer.cs (2)
56resultKind: LookupResultKind.Viable, 504resultKind: LookupResultKind.Viable,
Generated\BoundNodes.xml.Generated.cs (48)
961public BoundBadExpression(SyntaxNode syntax, LookupResultKind resultKind, ImmutableArray<Symbol?> symbols, ImmutableArray<BoundExpression> childBoundNodes, TypeSymbol? type, bool hasErrors = false) 973public override LookupResultKind ResultKind { get; } 980public BoundBadExpression Update(LookupResultKind resultKind, ImmutableArray<Symbol?> symbols, ImmutableArray<BoundExpression> childBoundNodes, TypeSymbol? type) 1164public BoundUnaryOperator(SyntaxNode syntax, UnaryOperatorKind operatorKind, BoundExpression operand, ConstantValue? constantValueOpt, MethodSymbol? methodOpt, TypeSymbol? constrainedToTypeOpt, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, TypeSymbol type, bool hasErrors = false) 1186public override LookupResultKind ResultKind { get; } 1192public BoundUnaryOperator Update(UnaryOperatorKind operatorKind, BoundExpression operand, ConstantValue? constantValueOpt, MethodSymbol? methodOpt, TypeSymbol? constrainedToTypeOpt, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, TypeSymbol type) 1206public BoundIncrementOperator(SyntaxNode syntax, UnaryOperatorKind operatorKind, BoundExpression operand, MethodSymbol? methodOpt, TypeSymbol? constrainedToTypeOpt, BoundValuePlaceholder? operandPlaceholder, BoundExpression? operandConversion, BoundValuePlaceholder? resultPlaceholder, BoundExpression? resultConversion, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, TypeSymbol type, bool hasErrors = false) 1234public override LookupResultKind ResultKind { get; } 1240public BoundIncrementOperator Update(UnaryOperatorKind operatorKind, BoundExpression operand, MethodSymbol? methodOpt, TypeSymbol? constrainedToTypeOpt, BoundValuePlaceholder? operandPlaceholder, BoundExpression? operandConversion, BoundValuePlaceholder? resultPlaceholder, BoundExpression? resultConversion, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, TypeSymbol type) 1427public BoundFunctionPointerInvocation(SyntaxNode syntax, BoundExpression invokedExpression, ImmutableArray<BoundExpression> arguments, ImmutableArray<RefKind> argumentRefKindsOpt, LookupResultKind resultKind, TypeSymbol type, bool hasErrors = false) 1445public override LookupResultKind ResultKind { get; } 1450public BoundFunctionPointerInvocation Update(BoundExpression invokedExpression, ImmutableArray<BoundExpression> arguments, ImmutableArray<RefKind> argumentRefKindsOpt, LookupResultKind resultKind, TypeSymbol type) 1642public BoundBinaryOperator(SyntaxNode syntax, BinaryOperatorKind operatorKind, BoundBinaryOperator.UncommonData? data, LookupResultKind resultKind, BoundExpression left, BoundExpression right, TypeSymbol type, bool hasErrors = false) 1657public override LookupResultKind ResultKind { get; } 1662public BoundBinaryOperator Update(BinaryOperatorKind operatorKind, BoundBinaryOperator.UncommonData? data, LookupResultKind resultKind, BoundExpression left, BoundExpression right, TypeSymbol type) 1714public BoundUserDefinedConditionalLogicalOperator(SyntaxNode syntax, BinaryOperatorKind operatorKind, MethodSymbol logicalOperator, MethodSymbol trueOperator, MethodSymbol falseOperator, BoundValuePlaceholder? trueFalseOperandPlaceholder, BoundExpression? trueFalseOperandConversion, TypeSymbol? constrainedToTypeOpt, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, BoundExpression left, BoundExpression right, TypeSymbol type, bool hasErrors = false) 1747public override LookupResultKind ResultKind { get; } 1753public BoundUserDefinedConditionalLogicalOperator Update(BinaryOperatorKind operatorKind, MethodSymbol logicalOperator, MethodSymbol trueOperator, MethodSymbol falseOperator, BoundValuePlaceholder? trueFalseOperandPlaceholder, BoundExpression? trueFalseOperandConversion, TypeSymbol? constrainedToTypeOpt, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, BoundExpression left, BoundExpression right, TypeSymbol type) 1767public BoundCompoundAssignmentOperator(SyntaxNode syntax, BinaryOperatorSignature @operator, BoundExpression left, BoundExpression right, BoundValuePlaceholder? leftPlaceholder, BoundExpression? leftConversion, BoundValuePlaceholder? finalPlaceholder, BoundExpression? finalConversion, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, TypeSymbol type, bool hasErrors = false) 1794public override LookupResultKind ResultKind { get; } 1800public BoundCompoundAssignmentOperator Update(BinaryOperatorSignature @operator, BoundExpression left, BoundExpression right, BoundValuePlaceholder? leftPlaceholder, BoundExpression? leftConversion, BoundValuePlaceholder? finalPlaceholder, BoundExpression? finalConversion, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, TypeSymbol type) 5721protected BoundMethodOrPropertyGroup(BoundKind kind, SyntaxNode syntax, BoundExpression? receiverOpt, LookupResultKind resultKind, bool hasErrors = false) 5730public override LookupResultKind ResultKind { get; } 6072public BoundMethodGroup(SyntaxNode syntax, ImmutableArray<TypeWithAnnotations> typeArgumentsOpt, string name, ImmutableArray<MethodSymbol> methods, Symbol? lookupSymbolOpt, DiagnosticInfo? lookupError, BoundMethodGroupFlags? flags, FunctionTypeSymbol? functionType, BoundExpression? receiverOpt, LookupResultKind resultKind, bool hasErrors = false) 6099public BoundMethodGroup Update(ImmutableArray<TypeWithAnnotations> typeArgumentsOpt, string name, ImmutableArray<MethodSymbol> methods, Symbol? lookupSymbolOpt, DiagnosticInfo? lookupError, BoundMethodGroupFlags? flags, FunctionTypeSymbol? functionType, BoundExpression? receiverOpt, LookupResultKind resultKind) 6113public BoundPropertyGroup(SyntaxNode syntax, ImmutableArray<PropertySymbol> properties, BoundExpression? receiverOpt, LookupResultKind resultKind, bool hasErrors = false) 6127public BoundPropertyGroup Update(ImmutableArray<PropertySymbol> properties, BoundExpression? receiverOpt, LookupResultKind resultKind) 6141public BoundCall(SyntaxNode syntax, BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, MethodSymbol method, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, bool isDelegateCall, bool expanded, bool invokedAsExtensionMethod, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalMethodsOpt, TypeSymbol type, bool hasErrors = false) 6180public override LookupResultKind ResultKind { get; } 6186public BoundCall Update(BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, MethodSymbol method, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, bool isDelegateCall, bool expanded, bool invokedAsExtensionMethod, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalMethodsOpt, TypeSymbol type) 6239public BoundAttribute(SyntaxNode syntax, MethodSymbol? constructor, ImmutableArray<BoundExpression> constructorArguments, ImmutableArray<string?> constructorArgumentNamesOpt, ImmutableArray<int> constructorArgumentsToParamsOpt, bool constructorExpanded, BitVector constructorDefaultArguments, ImmutableArray<BoundAssignmentOperator> namedArguments, LookupResultKind resultKind, TypeSymbol type, bool hasErrors = false) 6265public override LookupResultKind ResultKind { get; } 6270public BoundAttribute Update(MethodSymbol? constructor, ImmutableArray<BoundExpression> constructorArguments, ImmutableArray<string?> constructorArgumentNamesOpt, ImmutableArray<int> constructorArgumentsToParamsOpt, bool constructorExpanded, BitVector constructorDefaultArguments, ImmutableArray<BoundAssignmentOperator> namedArguments, LookupResultKind resultKind, TypeSymbol type) 6745public BoundObjectInitializerMember(SyntaxNode syntax, Symbol? memberSymbol, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, bool expanded, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, LookupResultKind resultKind, AccessorKind accessorKind, TypeSymbol receiverType, TypeSymbol type, bool hasErrors = false) 6773public override LookupResultKind ResultKind { get; } 6780public BoundObjectInitializerMember Update(Symbol? memberSymbol, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, bool expanded, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, LookupResultKind resultKind, AccessorKind accessorKind, TypeSymbol receiverType, TypeSymbol type) 6867public BoundCollectionElementInitializer(SyntaxNode syntax, MethodSymbol addMethod, ImmutableArray<BoundExpression> arguments, BoundExpression? implicitReceiverOpt, bool expanded, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, bool invokedAsExtensionMethod, LookupResultKind resultKind, TypeSymbol type, bool hasErrors = false) 6893public override LookupResultKind ResultKind { get; } 6898public BoundCollectionElementInitializer Update(MethodSymbol addMethod, ImmutableArray<BoundExpression> arguments, BoundExpression? implicitReceiverOpt, bool expanded, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, bool invokedAsExtensionMethod, LookupResultKind resultKind, TypeSymbol type) 7259public BoundFieldAccess(SyntaxNode syntax, BoundExpression? receiverOpt, FieldSymbol fieldSymbol, ConstantValue? constantValueOpt, LookupResultKind resultKind, bool isByValue, bool isDeclaration, TypeSymbol type, bool hasErrors = false) 7278public override LookupResultKind ResultKind { get; } 7285public BoundFieldAccess Update(BoundExpression? receiverOpt, FieldSymbol fieldSymbol, ConstantValue? constantValueOpt, LookupResultKind resultKind, bool isByValue, bool isDeclaration, TypeSymbol type) 7339public BoundPropertyAccess(SyntaxNode syntax, BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, PropertySymbol propertySymbol, AccessorKind autoPropertyAccessorKind, LookupResultKind resultKind, TypeSymbol type, bool hasErrors = false) 7358public override LookupResultKind ResultKind { get; } 7363public BoundPropertyAccess Update(BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, PropertySymbol propertySymbol, AccessorKind autoPropertyAccessorKind, LookupResultKind resultKind, TypeSymbol type) 7377public BoundEventAccess(SyntaxNode syntax, BoundExpression? receiverOpt, EventSymbol eventSymbol, bool isUsableAsField, LookupResultKind resultKind, TypeSymbol type, bool hasErrors = false) 7394public override LookupResultKind ResultKind { get; } 7399public BoundEventAccess Update(BoundExpression? receiverOpt, EventSymbol eventSymbol, bool isUsableAsField, LookupResultKind resultKind, TypeSymbol type)
Lowering\ClosureConversion\ClosureConversion.cs (1)
1734return new BoundBadExpression(F.Syntax, LookupResultKind.Empty, ImmutableArray<Symbol>.Empty, ImmutableArray.Create<BoundExpression>(node), node.Type);
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (4)
351return new BoundBadExpression(node.Syntax, default(LookupResultKind), ImmutableArray<Symbol>.Empty, ImmutableArray.Create<BoundExpression>(node), ExpressionType); 1091return new BoundBadExpression(node.Syntax, default(LookupResultKind), ImmutableArray<Symbol>.Empty, ImmutableArray.Create<BoundExpression>(node), node.Type); 1098return new BoundBadExpression(node.Syntax, default(LookupResultKind), ImmutableArray<Symbol>.Empty, ImmutableArray.Create<BoundExpression>(node), node.Type); 1130return new BoundBadExpression(node.Syntax, default(LookupResultKind), ImmutableArray<Symbol>.Empty, ImmutableArray.Create<BoundExpression>(node), node.Type);
Lowering\LocalRewriter\LocalRewriter.cs (2)
318var result = new BoundFieldAccess(node.Syntax, new BoundThisReference(node.Syntax, primaryCtor.ContainingType), field, ConstantValue.NotAvailable, LookupResultKind.Viable, node.Type); 593return new BoundBadExpression(syntax, LookupResultKind.NotReferencable, ImmutableArray<Symbol?>.Empty, children, resultType);
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 (8)
541new BoundBinaryOperator(syntax, operatorKind, constantValueOpt: null, methodOpt: null, constrainedToTypeOpt: null, LookupResultKind.Viable, loweredLeft, loweredRight, type); 756return new BoundUnaryOperator(syntax, UnaryOperatorKind.BoolLogicalNegation, converted, ConstantValue.NotAvailable, MethodSymbol.None, constrainedToTypeOpt: null, LookupResultKind.Viable, boolean) 2008new BoundUnaryOperator(syntax, UnaryOperatorKind.BoolLogicalNegation, call, ConstantValue.NotAvailable, null, constrainedToTypeOpt: null, LookupResultKind.Viable, returnType); 2038return new BoundBinaryOperator(syntax, operatorKind, constantValueOpt: null, methodOpt: null, constrainedToTypeOpt: null, LookupResultKind.Empty, loweredLeft, loweredRight, type); 2048? new BoundBinaryOperator(syntax, operatorKind, null, method, constrainedToTypeOpt: null, default(LookupResultKind), loweredLeft, loweredRight, method.ReturnType) 2178LookupResultKind.Viable, 2191LookupResultKind.Viable, 2303LookupResultKind.Viable,
Lowering\LocalRewriter\LocalRewriter_Call.cs (3)
462LookupResultKind resultKind, 549resultKind: LookupResultKind.Viable, 1532resultKind: LookupResultKind.Viable,
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (1)
505resultKind: LookupResultKind.Viable,
Lowering\LocalRewriter\LocalRewriter_Event.cs (6)
128clearCall = new BoundBadExpression(syntax, LookupResultKind.NotInvocable, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create<BoundExpression>(removeDelegate), ErrorTypeSymbol.UnknownResultType); 170marshalCall = new BoundBadExpression(syntax, LookupResultKind.NotInvocable, ImmutableArray<Symbol?>.Empty, marshalArguments, ErrorTypeSymbol.UnknownResultType); 224LookupResultKind resultKind, 265getOrCreateCall = new BoundBadExpression(syntax, LookupResultKind.NotInvocable, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create<BoundExpression>(fieldAccess), ErrorTypeSymbol.UnknownResultType); 287return new BoundBadExpression(syntax, LookupResultKind.NotInvocable, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create(getOrCreateCall), ErrorTypeSymbol.UnknownResultType); 333return new BoundBadExpression(node.Syntax, LookupResultKind.NotCreatable, ImmutableArray.Create<Symbol?>(node.Event),
Lowering\LocalRewriter\LocalRewriter_Field.cs (1)
22LookupResultKind resultKind,
Lowering\LocalRewriter\LocalRewriter_FixedStatement.cs (2)
485helperCall = new BoundBadExpression(fixedInitializer.Syntax, LookupResultKind.NotInvocable, ImmutableArray<Symbol?>.Empty, ImmutableArray<BoundExpression>.Empty, ErrorTypeSymbol.UnknownResultType); 546lengthCall = new BoundBadExpression(fixedInitializer.Syntax, LookupResultKind.NotInvocable, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create<BoundExpression>(factory.Local(pinnedTemp)), ErrorTypeSymbol.UnknownResultType);
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (5)
462resultKind: LookupResultKind.Viable, 665resultKind: LookupResultKind.Viable, 961resultKind: LookupResultKind.Viable, 1165resultKind: LookupResultKind.Viable, 1261resultKind: LookupResultKind.Viable,
Lowering\LocalRewriter\LocalRewriter_LockStatement.cs (2)
117exitCallExpr = new BoundBadExpression(lockSyntax, LookupResultKind.NotInvocable, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create<BoundExpression>(boundLockTemp), ErrorTypeSymbol.UnknownResultType); 212enterCallExpr = new BoundBadExpression(lockSyntax, LookupResultKind.NotInvocable, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create<BoundExpression>(boundLockTemp), ErrorTypeSymbol.UnknownResultType);
Lowering\LocalRewriter\LocalRewriter_ObjectCreationExpression.cs (4)
358resultKind: LookupResultKind.Viable, 389newGuid = new BoundBadExpression(node.Syntax, LookupResultKind.NotCreatable, ImmutableArray<Symbol?>.Empty, ImmutableArray<BoundExpression>.Empty, ErrorTypeSymbol.UnknownResultType); 407callGetTypeFromCLSID = new BoundBadExpression(node.Syntax, LookupResultKind.OverloadResolutionFailure, ImmutableArray<Symbol?>.Empty, ImmutableArray<BoundExpression>.Empty, ErrorTypeSymbol.UnknownResultType); 419rewrittenObjectCreation = new BoundBadExpression(node.Syntax, LookupResultKind.OverloadResolutionFailure, ImmutableArray<Symbol?>.Empty, ImmutableArray<BoundExpression>.Empty, node.Type);
Lowering\LocalRewriter\LocalRewriter_PropertyAccess.cs (3)
30LookupResultKind resultKind, 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_StackAlloc.cs (1)
69resultKind: LookupResultKind.NotInvocable,
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (1)
563currentResult = new BoundBinaryOperator(current.Syntax, current.OperatorKind, constantValueOpt: null, method, constrainedToTypeOpt: null, default(LookupResultKind), currentResult, right, current.Type);
Lowering\LocalRewriter\LocalRewriter_StringInterpolation.cs (1)
228: new BoundBadExpression(syntax, LookupResultKind.Empty, symbols: ImmutableArray<Symbol?>.Empty, childBoundNodes: ImmutableArray<BoundExpression>.Empty, 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 (2)
463disposeCall = new BoundBadExpression(resourceSyntax, LookupResultKind.NotInvocable, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create(disposedExpression), ErrorTypeSymbol.UnknownResultType); 534return MakeCall(null, syntax, expression, method, rewrittenArguments, argumentRefKindsOpt, LookupResultKind.Viable, temps.ToImmutableAndFree());
Lowering\LocalRewriter\LoweredDynamicOperation.cs (1)
55var bad = new BoundBadExpression(children[0].Syntax, LookupResultKind.Empty, ImmutableArray<Symbol?>.Empty, children, resultType);
Lowering\SyntheticBoundNodeFactory.cs (8)
241return new BoundBadExpression(Syntax, LookupResultKind.Empty, ImmutableArray<Symbol?>.Empty, ImmutableArray<BoundExpression>.Empty, type, hasErrors: true); 251return new BoundFieldAccess(Syntax, receiver, f, ConstantValue.NotAvailable, LookupResultKind.Viable, f.Type) { WasCompilerGenerated = true }; 644return new BoundBinaryOperator(this.Syntax, kind, ConstantValue.NotAvailable, methodOpt: null, constrainedToTypeOpt: null, LookupResultKind.Viable, left, right, type) { WasCompilerGenerated = true }; 802return new BoundBadExpression(Syntax, default(LookupResultKind), ImmutableArray<Symbol?>.Empty, args.AsImmutable(), receiver); 867invokedAsExtensionMethod: false, argsToParamsOpt: default(ImmutableArray<int>), defaultArguments: default(BitVector), resultKind: LookupResultKind.Viable, 908argsToParamsOpt: ImmutableArray<int>.Empty, defaultArguments: default(BitVector), resultKind: LookupResultKind.Viable, type: method.ReturnType) 1641return new BoundUnaryOperator(expression.Syntax, UnaryOperatorKind.BoolLogicalNegation, expression, null, null, constrainedToTypeOpt: null, LookupResultKind.Viable, expression.Type); 1888new BoundUnaryOperator(syntax, UnaryOperatorKind.BoolLogicalNegation, call, ConstantValue.NotAvailable, methodOpt: null, constrainedToTypeOpt: null, LookupResultKind.Viable, returnType);
Operations\CSharpOperationFactory.cs (4)
478if (boundFunctionPointerInvocation.ResultKind != LookupResultKind.Viable) 631if (!boundIndexerAccess.OriginalIndexersOpt.IsDefault || boundIndexerAccess.ResultKind == LookupResultKind.OverloadResolutionFailure) 711if (boundObjectCreationExpression.ResultKind == LookupResultKind.OverloadResolutionFailure || constructor.OriginalDefinition is ErrorMethodSymbol) 887if (accessor == null || boundObjectInitializerMember.ResultKind == LookupResultKind.OverloadResolutionFailure || accessor.OriginalDefinition is ErrorMethodSymbol)
Operations\CSharpOperationFactory_Methods.cs (2)
121private bool IsMethodInvalid(LookupResultKind resultKind, MethodSymbol targetMethod) => 122resultKind == LookupResultKind.OverloadResolutionFailure || targetMethod?.OriginalDefinition is ErrorMethodSymbol;
Symbols\ErrorTypeSymbol.cs (4)
35internal virtual LookupResultKind ResultKind { get { return LookupResultKind.Empty; } } 73Debug.Assert(ResultKind != LookupResultKind.Viable, "Shouldn't have viable result kind on error symbol"); 645internal override LookupResultKind ResultKind
Symbols\ExtendedErrorTypeSymbol.cs (8)
26private readonly LookupResultKind _resultKind; // why the guessSymbols were wrong. 49_resultKind = LookupResultKind.Empty; 52private ExtendedErrorTypeSymbol(NamespaceOrTypeSymbol? containingSymbol, string name, int arity, DiagnosticInfo? errorInfo, bool unreported, bool variableUsedBeforeDeclaration, ImmutableArray<Symbol> candidateSymbols, LookupResultKind resultKind) 64internal ExtendedErrorTypeSymbol(NamespaceOrTypeSymbol guessSymbol, LookupResultKind resultKind, DiagnosticInfo errorInfo, bool unreported = false) 69internal ExtendedErrorTypeSymbol(NamespaceOrTypeSymbol? containingSymbol, Symbol guessSymbol, LookupResultKind resultKind, DiagnosticInfo errorInfo, bool unreported = false) 74internal ExtendedErrorTypeSymbol(NamespaceOrTypeSymbol? containingSymbol, ImmutableArray<Symbol> candidateSymbols, LookupResultKind resultKind, DiagnosticInfo errorInfo, int arity, bool unreported = false) 79Debug.Assert(candidateSymbols.IsEmpty || resultKind != LookupResultKind.Viable, "Shouldn't use LookupResultKind.Viable with candidate symbols"); 107internal override LookupResultKind ResultKind
Symbols\Metadata\PE\PENamedTypeSymbol.cs (1)
2129return new ExtendedErrorTypeSymbol(declaredBase, LookupResultKind.NotReferencable, info, true);
Symbols\Retargeting\RetargetingNamedTypeSymbol.cs (1)
309return new ExtendedErrorTypeSymbol(declaredBase, LookupResultKind.NotReferencable, info, true);
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (4)
342baseType = new ExtendedErrorTypeSymbol(baseType, LookupResultKind.Ambiguous, info); 532localBase = new ExtendedErrorTypeSymbol(localBase, LookupResultKind.NotReferencable, info); 678result.Add(new ExtendedErrorTypeSymbol(t, LookupResultKind.NotReferencable, 760return new ExtendedErrorTypeSymbol(declaredBase, LookupResultKind.NotReferencable,
Symbols\Synthesized\SynthesizedEntryPointSymbol.cs (2)
308resultKind: LookupResultKind.Viable, 371resultKind: LookupResultKind.Viable,
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (2)
Semantics\InteractiveSemanticModelTests.cs (1)
47Assert.Equal(LookupResultKind.Inaccessible, baseType.GetSymbol<ErrorTypeSymbol>().ResultKind); // Script class members are private.
Semantics\LookupTests.cs (1)
450Assert.True(lookupResult.IsMultiViable || lookupResult.Kind == LookupResultKind.NotReferencable);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
DocumentationComments\CrefTests.cs (1)
5529Assert.Equal(LookupResultKind.Viable, lookupResult.Kind);
Symbols\ConversionTests.cs (1)
2081Assert.Equal(LookupResultKind.OverloadResolutionFailure, elementConversion.ResultKind);