1 write to _diagnostics
Microsoft.CodeAnalysis.CSharp (1)
Lowering\LocalRewriter\LocalRewriter.cs (1)
77_diagnostics = diagnostics;
72 references to _diagnostics
Microsoft.CodeAnalysis.CSharp (72)
Lowering\LocalRewriter\LocalRewriter.cs (6)
252this._diagnostics.Add(ErrorCode.ERR_InterceptorCannotInterceptNameof, nameofIdentiferSyntax.Location); 346_factory.ModuleBuilderOpt.EnsureParamCollectionAttributeExists(_diagnostics, location); 600symbol = (TSymbol?)Binder.GetWellKnownTypeMember(_compilation, member, _diagnostics, syntax: syntax, isOptional: isOptional, location: location); 611return UnsafeGetSpecialTypeMethod(syntax, specialMember, _compilation, _diagnostics); 638return TryGetSpecialTypeMethod(syntax, specialMember, _compilation, _diagnostics, out method, isOptional); 1136return new CompoundUseSiteInfo<AssemblySymbol>(_diagnostics, _compilation.Assembly);
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (1)
923var privateImplClass = module.GetPrivateImplClass(syntaxNode, _localRewriter._diagnostics.DiagnosticBag);
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (2)
214_localRewriter._diagnostics.Add(t.Syntax, useSiteInfo); 493_localRewriter._diagnostics.Add(test.Syntax, useSiteInfo);
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (2)
739_diagnostics.Add(loweredLeft.Syntax, useSiteInfo); 1896return UnsafeGetNullableMethod(syntax, nullableType, member, _compilation, _diagnostics);
Lowering\LocalRewriter\LocalRewriter_Call.cs (16)
110module.EmbeddedTypesManagerOpt.EmbedMethodIfNeedTo(m.OriginalDefinition.GetCciAdapter(), syntaxNode, _diagnostics.DiagnosticBag); 129module.EmbeddedTypesManagerOpt.EmbedPropertyIfNeedTo(p.OriginalDefinition.GetCciAdapter(), syntaxNode, _diagnostics.DiagnosticBag); 163this._diagnostics.Add(ErrorCode.ERR_InterceptorCannotBeGeneric, attributeLocation, interceptor, method); 169this._diagnostics.Add(ErrorCode.ERR_InterceptorArityNotCompatible, attributeLocation, interceptor, netArity, method); 175if (!interceptor.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(this._compilation, this._compilation.Conversions, includeNullability: true, attributeLocation, this._diagnostics))) 183this._diagnostics.Add(ErrorCode.ERR_InterceptableMethodMustBeOrdinary, attributeLocation, nameSyntax.Identifier.ValueText); 192this._diagnostics.Add(attributeLocation, useSiteInfo); 195this._diagnostics.Add(ErrorCode.ERR_InterceptorNotAccessible, attributeLocation, interceptor, containingMethod); 207this._diagnostics.Add(ErrorCode.ERR_InterceptorSignatureMismatch, attributeLocation, method, interceptor); 215_diagnostics, 228this._diagnostics.Add(ErrorCode.WRN_InterceptorSignatureMismatch, attributeLocation, method, interceptor); 239this._diagnostics.Add(ErrorCode.ERR_InterceptorMustHaveMatchingThisParameter, attributeLocation, methodThisParameter, method); 242this._diagnostics.Add(ErrorCode.ERR_InterceptorMustNotHaveThisParameter, attributeLocation, method); 251this._diagnostics.Add(ErrorCode.ERR_InterceptorMustHaveMatchingThisParameter, attributeLocation, method.Parameters[0], method); 258this._diagnostics, 1432_diagnostics.ReportUseSite(arrayEmpty, syntax);
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (7)
398Debug.Assert(_diagnostics.DiagnosticBag is { }); 431var synthesizedType = _factory.ModuleBuilderOpt.EnsureReadOnlyListTypeExists(syntax, kind: kind, _diagnostics.DiagnosticBag).Construct(typeArgs); 549Debug.Assert(_diagnostics.DiagnosticBag is { }); 571var inlineArrayType = _factory.ModuleBuilderOpt.EnsureInlineArrayTypeExists(syntax, _factory, arrayLength, _diagnostics.DiagnosticBag).Construct(ImmutableArray.Create(elementType)); 575MethodSymbol elementRef = _factory.ModuleBuilderOpt.EnsureInlineArrayElementRefExists(syntax, intType, _diagnostics.DiagnosticBag). 603_factory.ModuleBuilderOpt.EnsureInlineArrayAsReadOnlySpanExists(syntax, _factory.WellKnownType(WellKnownType.System_ReadOnlySpan_T), intType, _diagnostics.DiagnosticBag) : 604_factory.ModuleBuilderOpt.EnsureInlineArrayAsSpanExists(syntax, _factory.WellKnownType(WellKnownType.System_Span_T), intType, _diagnostics.DiagnosticBag);
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (7)
133_diagnostics.Add( 310Debug.Assert(_diagnostics.DiagnosticBag is { }); 603createSpan = _factory.ModuleBuilderOpt.EnsureInlineArrayAsReadOnlySpanExists(syntax, spanType.OriginalDefinition, _factory.SpecialType(SpecialType.System_Int32), _diagnostics.DiagnosticBag); 608createSpan = _factory.ModuleBuilderOpt.EnsureInlineArrayAsSpanExists(syntax, spanType.OriginalDefinition, _factory.SpecialType(SpecialType.System_Int32), _diagnostics.DiagnosticBag); 748_factory.ModuleBuilderOpt.EnsureParamCollectionAttributeExists(_diagnostics, node.Location); 789Conversion conversion = MakeConversion(rewrittenOperand, rewrittenType, @checked: @checked, _compilation, _diagnostics, acceptFailingConversion); 1857_diagnostics.Add(syntax, useSiteInfo);
Lowering\LocalRewriter\LocalRewriter_DeconstructionAssignmentOperator.cs (1)
266compilation: _compilation, shouldCheckConstraints: false, includeNullability: false, errorPositions: default, syntax: (CSharpSyntaxNode)right.Syntax, diagnostics: _diagnostics);
Lowering\LocalRewriter\LocalRewriter_Event.cs (3)
37_diagnostics.Add(errorInfo, node.Syntax.Location); 278_diagnostics.Add(new CSDiagnosticInfo(ErrorCode.ERR_MissingPredefinedMember, invocationListProperty.ContainingType, accessorName), syntax.Location); 325module.EmbeddedTypesManagerOpt.EmbedEventIfNeedTo(node.Event.GetCciAdapter(), node.Syntax, _diagnostics.DiagnosticBag, isUsedForComAwareEventBinding: true);
Lowering\LocalRewriter\LocalRewriter_Field.cs (2)
75var tupleRestField = (FieldSymbol?)NamedTypeSymbol.GetWellKnownMemberInType(currentLinkType.OriginalDefinition, wellKnownTupleRest, _diagnostics, syntax); 110_diagnostics.Add(useSiteInfo, syntax);
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (7)
294disposeMethod = (MethodSymbol)Binder.GetWellKnownTypeMember(_compilation, WellKnownMember.System_IAsyncDisposable__DisposeAsync, _diagnostics, syntax: forEachSyntax); 298return Binder.TryGetSpecialTypeMember(_compilation, SpecialMember.System_IDisposable__Dispose, forEachSyntax, _diagnostics, out disposeMethod); 342_diagnostics.Add(forEachSyntax, useSiteInfo); 345Binder.ReportDiagnosticsIfObsolete(_diagnostics, disposeMethod, forEachSyntax, 771Debug.Assert(rewriter._diagnostics.DiagnosticBag is { }); 776elementRef = rewriter._factory.ModuleBuilderOpt.EnsureInlineArrayElementRefExists(syntax, intType, rewriter._diagnostics.DiagnosticBag); 781elementRef = rewriter._factory.ModuleBuilderOpt.EnsureInlineArrayElementRefReadOnlyExists(syntax, intType, rewriter._diagnostics.DiagnosticBag);
Lowering\LocalRewriter\LocalRewriter_FunctionPointerInvocation.cs (1)
40this._diagnostics.Add(ErrorCode.ERR_InterceptableMethodMustBeOrdinary, attributeLocation, nameSyntax.Identifier.ValueText);
Lowering\LocalRewriter\LocalRewriter_IndexerAccess.cs (7)
202Debug.Assert(_diagnostics.DiagnosticBag is { }); 328createSpan = _factory.ModuleBuilderOpt.EnsureInlineArrayAsReadOnlySpanExists(node.Syntax, spanType, intType, _diagnostics.DiagnosticBag); 332createSpan = _factory.ModuleBuilderOpt.EnsureInlineArrayAsSpanExists(node.Syntax, spanType, intType, _diagnostics.DiagnosticBag); 354elementRef = _factory.ModuleBuilderOpt.EnsureInlineArrayFirstElementRefExists(node.Syntax, _diagnostics.DiagnosticBag); 359elementRef = _factory.ModuleBuilderOpt.EnsureInlineArrayFirstElementRefReadOnlyExists(node.Syntax, _diagnostics.DiagnosticBag); 373elementRef = _factory.ModuleBuilderOpt.EnsureInlineArrayElementRefExists(node.Syntax, intType, _diagnostics.DiagnosticBag); 378elementRef = _factory.ModuleBuilderOpt.EnsureInlineArrayElementRefReadOnlyExists(node.Syntax, intType, _diagnostics.DiagnosticBag);
Lowering\LocalRewriter\LocalRewriter_LockStatement.cs (1)
45if (LockBinder.TryFindLockTypeInfo(argumentType, _diagnostics, rewrittenArgument.Syntax) is not { } lockTypeInfo)
Lowering\LocalRewriter\LocalRewriter_ObjectCreationExpression.cs (1)
343method.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(_compilation, _compilation.Conversions, syntax.GetLocation(), _diagnostics));
Lowering\LocalRewriter\LocalRewriter_StringInterpolation.cs (1)
225var toStringAndClear = (MethodSymbol)Binder.GetWellKnownTypeMember(_compilation, WellKnownMember.System_Runtime_CompilerServices_DefaultInterpolatedStringHandler__ToStringAndClear, _diagnostics, syntax: syntax);
Lowering\LocalRewriter\LocalRewriter_TupleCreationExpression.cs (4)
59_diagnostics, 69Binder.CheckRequiredMembersInObjectInitializer(smallestConstructor, initializers: ImmutableArray<BoundExpression>.Empty, syntax, _diagnostics); 76_diagnostics, 83Binder.CheckRequiredMembersInObjectInitializer(tuple8Ctor, initializers: ImmutableArray<BoundExpression>.Empty, syntax, _diagnostics);
Lowering\LocalRewriter\LocalRewriter_UsingStatement.cs (3)
166_diagnostics.ReportUseSite(iDisposableType, usingSyntax); 242_diagnostics.ReportUseSite(iDisposableType, usingSyntax); 451Binder.TryGetSpecialTypeMember(_compilation, SpecialMember.System_IDisposable__Dispose, resourceTypeSyntax, _diagnostics, out disposeMethod);