121 references to Discarded
Microsoft.CodeAnalysis.CSharp (121)
Binder\Binder.IdentifierUsedAsValueFinder.cs (8)
173UnboundLambda unboundLambda = enclosingBinder.AnalyzeAnonymousFunction(lambdaSyntax, BindingDiagnosticBag.Discarded); 272Symbol symbol = enclosingBinder.GetSymbolOrMethodOrPropertyGroup(lookupResult, memberAccessNode, memberName, targetMemberArity, members, BindingDiagnosticBag.Discarded, wasError: out _, 313(QueryTranslationState state, _) = enclosingBinder.MakeInitialQueryTranslationState(query, BindingDiagnosticBag.Discarded); 323enclosingBinder.PrepareQueryTranslationStateForContinuation(state, continuation, BindingDiagnosticBag.Discarded); 440var x2 = state.AddRangeVariable(enclosingBinder, join.Identifier, BindingDiagnosticBag.Discarded); 449state.AddRangeVariable(enclosingBinder, join.Into.Identifier, BindingDiagnosticBag.Discarded); 496state.AddRangeVariable(enclosingBinder, from.Identifier, BindingDiagnosticBag.Discarded); 521var y = state.AddRangeVariable(enclosingBinder, let.Identifier, BindingDiagnosticBag.Discarded);
Binder\Binder.QueryTranslationState.cs (1)
89if (!error && (object)diagnostics != BindingDiagnosticBag.Discarded)
Binder\Binder_Await.cs (2)
121if (ReportBadAwaitContext(syntax, BindingDiagnosticBag.Discarded)) 127node: syntax, diagnostics: BindingDiagnosticBag.Discarded);
Binder\Binder_Conversions.cs (3)
78var result2 = createConversion(syntax, placeholder2, conversion, isCast, conversionGroupOpt, wasCompilerGenerated, destination, BindingDiagnosticBag.Discarded, hasErrors); 455if (CheckValueKind(syntax, source, BindValueKind.RefersToLocation, checkingReceiver: false, BindingDiagnosticBag.Discarded)) 470if (CheckValueKind(syntax, source, BindValueKind.RefersToLocation | BindValueKind.Assignable, checkingReceiver: false, BindingDiagnosticBag.Discarded))
Binder\Binder_Crefs.cs (1)
93NamespaceOrTypeSymbol namespaceOrTypeSymbol = BindNamespaceOrTypeSymbol(syntax, BindingDiagnosticBag.Discarded).NamespaceOrTypeSymbol;
Binder\Binder_Expressions.cs (15)
270type is null ? BindToNaturalType(expression, BindingDiagnosticBag.Discarded, reportNoTargetType: false) : 271GenerateConversionForAssignment(type, expression, BindingDiagnosticBag.Discarded); 854node, LookupResultKind.Empty, ImmutableArray<Symbol>.Empty, ImmutableArray.Create<BoundExpression>(BindToTypeForErrorRecovery(BindValue(node.Expression, BindingDiagnosticBag.Discarded, BindValueKind.RefersToLocation))), 3220BindTypeOrAliasOrVarKeyword(typeSyntax, BindingDiagnosticBag.Discarded, out isVar); 3438if (!this.CheckValueKind(argument.Syntax, argument, BindValueKind.RefersToLocation, checkingReceiver: false, BindingDiagnosticBag.Discarded)) 3450if (this.CheckValueKind(argument.Syntax, argument, BindValueKind.Assignable, checkingReceiver: false, BindingDiagnosticBag.Discarded)) 4482builder.Add(BindToTypeForErrorRecovery(BindExpression(size, BindingDiagnosticBag.Discarded))); 6521BindToNaturalType(element.Expression, BindingDiagnosticBag.Discarded, reportNoTargetType: false), 7508TypeSymbol.Equals(BindNamespaceOrType(id, BindingDiagnosticBag.Discarded).Type, type, TypeCompareKind.AllIgnoreOptions); 9013diagnostics = BindingDiagnosticBag.Discarded; 9116if (CheckValueKind(node, expr, BindValueKind.RefersToLocation | BindValueKind.Assignable, checkingReceiver: false, BindingDiagnosticBag.Discarded)) 9128if (!CheckValueKind(node, expr, BindValueKind.RefersToLocation, checkingReceiver: false, BindingDiagnosticBag.Discarded)) 9449return CreateConversion(node, index, failedConversion, isCast: false, conversionGroupOpt: null, destination: int32, diagnostics: BindingDiagnosticBag.Discarded); 10525PopulateExtensionMethodsFromSingleBinder(scope, methodGroup, node.Syntax, receiver, node.Name, node.TypeArgumentsOpt, BindingDiagnosticBag.Discarded); 10691PopulateExtensionMethodsFromSingleBinder(scope, methodGroup, node.Syntax, receiver, node.Name, typeArguments, BindingDiagnosticBag.Discarded);
Binder\Binder_Initializers.cs (1)
301initializerDiagnostics = BindingDiagnosticBag.Discarded;
Binder\Binder_InterpolatedString.cs (1)
359construction.HasErrors ? BindingDiagnosticBag.Discarded : diagnostics,
Binder\Binder_Invocation.cs (3)
765resolution.MethodGroup, delegateTypeOpt: null, diagnostics: BindingDiagnosticBag.Discarded, queryClause: queryClause); 1344var result = !CheckValueKind(receiver.Syntax, receiver, valueKind, checkingReceiver: true, BindingDiagnosticBag.Discarded); 2226bool syntaxIsOk = CheckSyntaxForNameofArgument(argument, out string name, boundArgument.HasAnyErrors ? BindingDiagnosticBag.Discarded : diagnostics);
Binder\Binder_Operators.cs (1)
2599bool receiverIsLValue = CheckValueKind(receiver.Syntax, receiver, BindValueKind.AddressOf, checkingReceiver: false, diagnostics: BindingDiagnosticBag.Discarded);
Binder\Binder_Patterns.cs (3)
348var success = BindLengthAndIndexerForListPattern(node, inputType, BindingDiagnosticBag.Discarded, 694convertedExpression = CreateConversion(operand, inputType.GetNullableUnderlyingType(), BindingDiagnosticBag.Discarded); 908expressionVariableField.SetTypeWithAnnotations(declType, BindingDiagnosticBag.Discarded);
Binder\Binder_Query.cs (1)
204BoundExpression? unoptimized = FinalTranslation(state, BindingDiagnosticBag.Discarded);
Binder\Binder_Statements.cs (8)
538var value = BindRValueWithoutTargetType(node.Expression, BindingDiagnosticBag.Discarded); 572expressionBody = runAnalysis(BindExpressionBodyAsBlock(node.ExpressionBody, BindingDiagnosticBag.Discarded), BindingDiagnosticBag.Discarded); 1383elementConversionClassification.IsImplicit ? diagnostics : BindingDiagnosticBag.Discarded); 1935diagnostics = BindingDiagnosticBag.Discarded; 1984diagnostics = BindingDiagnosticBag.Discarded; 3750constructor.Body == null ? diagnostics : BindingDiagnosticBag.Discarded)); 4032blockBody == null ? diagnostics : BindingDiagnosticBag.Discarded));
Binder\BindingDiagnosticBag.cs (1)
57return Discarded;
Binder\ForEachLoopBinder.cs (4)
399iterationErrorExpression = BindToTypeForErrorRecovery(BindExpression(node.Variable, BindingDiagnosticBag.Discarded)); 789bool wrongAsync = GetEnumeratorInfoCore(syntax, collectionSyntax, ref originalCollectionExpr, !isAsync, BindingDiagnosticBag.Discarded, builder: out _) == EnumeratorResult.Succeeded; 821if (CheckValueKind(collectionExpr.Syntax, collectionExpr, BindValueKind.RefersToLocation | BindValueKind.Assignable, checkingReceiver: false, BindingDiagnosticBag.Discarded)) 829if (!CheckValueKind(collectionExpr.Syntax, collectionExpr, BindValueKind.RefersToLocation, checkingReceiver: false, BindingDiagnosticBag.Discarded))
Binder\Semantics\Conversions\Conversions.cs (2)
191if (!_binder.HasCollectionExpressionApplicableConstructor(syntax, targetType, out constructor, out isExpanded, BindingDiagnosticBag.Discarded)) 197!_binder.HasCollectionExpressionApplicableAddMethod(syntax, targetType, addMethods: out _, BindingDiagnosticBag.Discarded))
Binder\Semantics\OverloadResolution\OverloadResolution.cs (3)
1343if (!binder.HasCollectionExpressionApplicableConstructor(syntax, type, constructor: out _, isExpanded: out _, BindingDiagnosticBag.Discarded)) 1348if (!binder.HasCollectionExpressionApplicableAddMethod(syntax, type, addMethods: out _, BindingDiagnosticBag.Discarded)) 3580bool result = !_binder.MethodIsCompatibleWithDelegateOrFunctionPointer(node.ReceiverOpt, conv.IsExtensionMethod, conv.Method, delegateType, Location.None, BindingDiagnosticBag.Discarded);
Binder\SwitchBinder.cs (1)
183BuildSwitchLabels(section.Labels, GetBinder(section), labels, BindingDiagnosticBag.Discarded);
Binder\SwitchExpressionBinder.cs (1)
192inputExpression ??= BindSwitchGoverningExpression(BindingDiagnosticBag.Discarded);
Binder\UsingStatementBinder.cs (1)
257bool implementsAlternateIDisposable = implementsInterface(fromExpression, alternateInterface, BindingDiagnosticBag.Discarded);
BoundTree\BoundIsPatternExpression.cs (1)
25BindingDiagnosticBag.Discarded,
BoundTree\BoundSwitchExpression.cs (1)
27BindingDiagnosticBag.Discarded,
BoundTree\BoundSwitchStatement.cs (1)
23BindingDiagnosticBag.Discarded,
BoundTree\UnboundLambda.cs (1)
718var block = BindLambdaBody(lambdaSymbol, lambdaBodyBinder, BindingDiagnosticBag.Discarded);
Compilation\CSharpSemanticModel.cs (12)
261boundNode = binder.BindNamespaceOrType(expression, BindingDiagnosticBag.Discarded); 266boundNode = binder.BindExpression(expression, BindingDiagnosticBag.Discarded); 298crefSymbols = ImmutableArray.Create<Symbol>(binder.BindType(expression, BindingDiagnosticBag.Discarded).Type); 327var symbols = binder.BindCref(crefSyntax, out unusedAmbiguityWinner, BindingDiagnosticBag.Discarded); 413NamedTypeSymbol attributeType = (NamedTypeSymbol)binder.BindType(attribute.Name, BindingDiagnosticBag.Discarded, out aliasOpt).Type; 415var boundNode = new ExecutableCodeBinder(attribute, binder.ContainingMemberOrLambda, binder).BindAttribute(attribute, attributeType, attributedMember: null, BindingDiagnosticBag.Discarded); 812BoundExpressionStatement bnode = binder.BindConstructorInitializer(constructorInitializer, BindingDiagnosticBag.Discarded); 885BoundExpressionStatement bnode = binder.BindConstructorInitializer(constructorInitializer, BindingDiagnosticBag.Discarded); 1752Symbol singleSymbol = binder.ResultSymbol(lookupResult, name, arity, this.Root, BindingDiagnosticBag.Discarded, true, out wasError, container, options); 2772var attributeType = (NamedTypeSymbol)binder.BindType(attribute.Name, BindingDiagnosticBag.Discarded, out aliasOpt).Type; 2854var bnode = binder.BindExpression(expression, BindingDiagnosticBag.Discarded); 2906var bnode = binder.BindExpression(expression, BindingDiagnosticBag.Discarded);
Compilation\MemberSemanticModel.cs (6)
204var boundRoot = binder.BindExpression(expression, BindingDiagnosticBag.Discarded); 1692BoundNode boundOuterExpression = this.Bind(incrementalBinder, nodeToBind, BindingDiagnosticBag.Discarded); 1724BoundNode boundOuterExpression = this.Bind(incrementalBinder, lambdaOrQuery, BindingDiagnosticBag.Discarded); 1988return Bind(binder, root, BindingDiagnosticBag.Discarded); 2114BoundNode boundStatement = this.Bind(incrementalBinder, nodeToBind, BindingDiagnosticBag.Discarded); 2143var boundNode = this.Bind(incrementalBinder, node, BindingDiagnosticBag.Discarded);
Compilation\PublicSemanticModel.cs (1)
20var attributeType = (NamedTypeSymbol)enclosingBinder.BindType(attribute.Name, BindingDiagnosticBag.Discarded, out aliasOpt).Type;
Compilation\SyntaxTreeSemanticModel.cs (6)
233BoundExpression bound = binder.BindExpression((ExpressionSyntax)node, BindingDiagnosticBag.Discarded); 347return binder.BindNamespaceAliasSymbol(node as IdentifierNameSyntax, BindingDiagnosticBag.Discarded); 353return binder.BindTypeOrAlias(type, BindingDiagnosticBag.Discarded, basesBeingResolved).Symbol; 357? binder.BindTypeOrAlias(type, BindingDiagnosticBag.Discarded, basesBeingResolved).Symbol 385return result ?? binder.BindTypeOrAlias(type, BindingDiagnosticBag.Discarded, basesBeingResolved).Symbol; 389return binder.BindNamespaceOrTypeOrAliasSymbol(type, BindingDiagnosticBag.Discarded, basesBeingResolved, basesBeingResolved != null).Symbol;
Compiler\DocumentationCommentCompiler.cs (1)
162diagnostics: BindingDiagnosticBag.Discarded,
Compiler\DocumentationCommentCompiler.DocumentationCommentWalker.cs (1)
74DocumentationCommentWalker walker = new DocumentationCommentWalker(compilation, BindingDiagnosticBag.Discarded, symbol, writer, includeElementNodes, documentedParameters: null, documentedTypeParameters: null);
Compiler\MethodCompiler.cs (2)
989DiagnosticsPass.IssueDiagnostics(_compilation, initializerStatements, BindingDiagnosticBag.Discarded, methodSymbol); 1875Debug.Assert(BindImplicitConstructorInitializerIfAny(method, compilationState, BindingDiagnosticBag.Discarded) is null);
FlowAnalysis\NullableWalker.cs (3)
1410Binder.BindFieldInitializers(compilation, null, method.IsStatic ? containingType.StaticInitializers : containingType.InstanceInitializers, BindingDiagnosticBag.Discarded, ref discardedInitializers); 1411return GetAfterInitializersState(compilation, method, InitializerRewriter.RewriteConstructor(discardedInitializers.BoundInitializers, method), constructorBody, diagnostics: BindingDiagnosticBag.Discarded); 1428diagnostics = BindingDiagnosticBag.Discarded;
Symbols\ConstraintsHelper.cs (1)
402BindingDiagnosticBag.Discarded, performOnlyCycleSafeValidation: true);
Symbols\MethodSymbol.cs (2)
1161if (type.Type.ContainsDynamic() && compilation.HasDynamicEmitAttributes(BindingDiagnosticBag.Discarded, Location.None)) 1171if (type.Type.ContainsTupleNames() && compilation.HasTupleNamesAttributes(BindingDiagnosticBag.Discarded, Location.None))
Symbols\Source\ExplicitInterfaceHelpers.cs (1)
29string methodName = GetMemberNameAndInterfaceSymbol(binder, explicitInterfaceSpecifierOpt, name, BindingDiagnosticBag.Discarded, out discardedExplicitInterfaceType, out discardedAliasOpt);
Symbols\Source\GlobalExpressionVariable.cs (2)
203binder.BindDeclaratorArguments((VariableDeclaratorSyntax)nodeToBind, BindingDiagnosticBag.Discarded); 207binder.BindExpression((ExpressionSyntax)nodeToBind, BindingDiagnosticBag.Discarded);
Symbols\Source\SourceAssemblySymbol.cs (1)
1500if (!attribute.HasErrors && ValidateAttributeUsageForNetModuleAttribute(attribute, netModuleNames[i], BindingDiagnosticBag.Discarded, ref uniqueAttributes))
Symbols\Source\SourceComplexParameterSymbol.cs (1)
237MakeDefaultExpression(BindingDiagnosticBag.Discarded, out var _, out var parameterEqualsValue);
Symbols\Source\SourceFieldLikeEventSymbol.cs (1)
179var field = new SourceEventFieldSymbol(this, declaratorSyntax, BindingDiagnosticBag.Discarded);
Symbols\Source\SourceLocalSymbol.cs (2)
324TypeWithAnnotations declType = this.TypeSyntaxBinder.BindTypeOrVarKeyword(typeSyntax, BindingDiagnosticBag.Discarded, out isVar); 342var diagnostics = BindingDiagnosticBag.Discarded;
Symbols\Source\SourceNamedTypeSymbol.cs (3)
61TypeSymbol bt = baseBinder.BindType(t, BindingDiagnosticBag.Discarded).Type; 104return new SourceNamedTypeSymbol(ContainingType, declaration, BindingDiagnosticBag.Discarded, newData); 435constraints = binder.BindTypeParameterConstraintClauses(this, typeParameters, typeParameterList, constraintClauses, BindingDiagnosticBag.Discarded, performOnlyCycleSafeValidation: true);
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (1)
226var curBaseSym = baseBinder.BindType(b, BindingDiagnosticBag.Discarded).Type;
Symbols\Symbol_Attributes.cs (2)
550var boundType = binder.BindType(attributeSyntax.Name, BindingDiagnosticBag.Discarded); 553beforeAttributePartBound: null, afterAttributePartBound: null, BindingDiagnosticBag.Discarded);
Symbols\Synthesized\Records\SynthesizedPrimaryConstructor.cs (1)
197TryGetBodyBinder().BindConstructorInitializer(GetSyntax().PrimaryConstructorBaseTypeIfClass, BindingDiagnosticBag.Discarded);
Symbols\Synthesized\SynthesizedEntryPointSymbol.cs (1)
374var success = binder.GetAwaitableExpressionInfo(userMainInvocation, out _getAwaiterGetResultCall!, _userMainReturnTypeSyntax, BindingDiagnosticBag.Discarded);
Symbols\Synthesized\SynthesizedFieldSymbolBase.cs (2)
62compilation.HasDynamicEmitAttributes(BindingDiagnosticBag.Discarded, Location.None) && 74compilation.HasTupleNamesAttributes(BindingDiagnosticBag.Discarded, Location.None) &&
Symbols\Synthesized\SynthesizedParameterSymbol.cs (2)
156if (type.Type.ContainsDynamic() && compilation.HasDynamicEmitAttributes(BindingDiagnosticBag.Discarded, Location.None) && compilation.CanEmitBoolean()) 172compilation.HasTupleNamesAttributes(BindingDiagnosticBag.Discarded, Location.None) &&
Symbols\Synthesized\SynthesizedStaticConstructor.cs (1)
410BindingDiagnosticBag.Discarded,