@@ -457,52 +457,52 @@ internal OverloadResolution OverloadResolution
457457 }
458458 }
459459
460- internal static void Error ( DiagnosticBag diagnostics , DiagnosticInfo info , SyntaxNode syntax )
460+ internal static void Error ( BindingDiagnosticBag diagnostics , DiagnosticInfo info , SyntaxNode syntax )
461461 {
462462 diagnostics . Add ( new CSDiagnostic ( info , syntax . Location ) ) ;
463463 }
464464
465- internal static void Error ( DiagnosticBag diagnostics , DiagnosticInfo info , Location location )
465+ internal static void Error ( BindingDiagnosticBag diagnostics , DiagnosticInfo info , Location location )
466466 {
467467 diagnostics . Add ( new CSDiagnostic ( info , location ) ) ;
468468 }
469469
470- internal static void Error ( DiagnosticBag diagnostics , ErrorCode code , CSharpSyntaxNode syntax )
470+ internal static void Error ( BindingDiagnosticBag diagnostics , ErrorCode code , CSharpSyntaxNode syntax )
471471 {
472472 diagnostics . Add ( new CSDiagnostic ( new CSDiagnosticInfo ( code ) , syntax . Location ) ) ;
473473 }
474474
475- internal static void Error ( DiagnosticBag diagnostics , ErrorCode code , CSharpSyntaxNode syntax , params object [ ] args )
475+ internal static void Error ( BindingDiagnosticBag diagnostics , ErrorCode code , CSharpSyntaxNode syntax , params object [ ] args )
476476 {
477477 diagnostics . Add ( new CSDiagnostic ( new CSDiagnosticInfo ( code , args ) , syntax . Location ) ) ;
478478 }
479479
480- internal static void Error ( DiagnosticBag diagnostics , ErrorCode code , SyntaxToken token )
480+ internal static void Error ( BindingDiagnosticBag diagnostics , ErrorCode code , SyntaxToken token )
481481 {
482482 diagnostics . Add ( new CSDiagnostic ( new CSDiagnosticInfo ( code ) , token . GetLocation ( ) ) ) ;
483483 }
484484
485- internal static void Error ( DiagnosticBag diagnostics , ErrorCode code , SyntaxToken token , params object [ ] args )
485+ internal static void Error ( BindingDiagnosticBag diagnostics , ErrorCode code , SyntaxToken token , params object [ ] args )
486486 {
487487 diagnostics . Add ( new CSDiagnostic ( new CSDiagnosticInfo ( code , args ) , token . GetLocation ( ) ) ) ;
488488 }
489489
490- internal static void Error ( DiagnosticBag diagnostics , ErrorCode code , SyntaxNodeOrToken syntax )
490+ internal static void Error ( BindingDiagnosticBag diagnostics , ErrorCode code , SyntaxNodeOrToken syntax )
491491 {
492492 Error ( diagnostics , code , syntax . GetLocation ( ) ) ;
493493 }
494494
495- internal static void Error ( DiagnosticBag diagnostics , ErrorCode code , SyntaxNodeOrToken syntax , params object [ ] args )
495+ internal static void Error ( BindingDiagnosticBag diagnostics , ErrorCode code , SyntaxNodeOrToken syntax , params object [ ] args )
496496 {
497497 Error ( diagnostics , code , syntax . GetLocation ( ) , args ) ;
498498 }
499499
500- internal static void Error ( DiagnosticBag diagnostics , ErrorCode code , Location location )
500+ internal static void Error ( BindingDiagnosticBag diagnostics , ErrorCode code , Location location )
501501 {
502502 diagnostics . Add ( new CSDiagnostic ( new CSDiagnosticInfo ( code ) , location ) ) ;
503503 }
504504
505- internal static void Error ( DiagnosticBag diagnostics , ErrorCode code , Location location , params object [ ] args )
505+ internal static void Error ( BindingDiagnosticBag diagnostics , ErrorCode code , Location location , params object [ ] args )
506506 {
507507 diagnostics . Add ( new CSDiagnostic ( new CSDiagnosticInfo ( code , args ) , location ) ) ;
508508 }
@@ -526,7 +526,15 @@ internal void ReportDiagnosticsIfObsolete(DiagnosticBag diagnostics, Symbol symb
526526 }
527527 }
528528
529- internal void ReportDiagnosticsIfObsolete ( DiagnosticBag diagnostics , Conversion conversion , SyntaxNodeOrToken node , bool hasBaseReceiver )
529+ internal void ReportDiagnosticsIfObsolete ( BindingDiagnosticBag diagnostics , Symbol symbol , SyntaxNodeOrToken node , bool hasBaseReceiver )
530+ {
531+ if ( diagnostics . DiagnosticBag is object )
532+ {
533+ ReportDiagnosticsIfObsolete ( diagnostics . DiagnosticBag , symbol , node , hasBaseReceiver ) ;
534+ }
535+ }
536+
537+ internal void ReportDiagnosticsIfObsolete ( BindingDiagnosticBag diagnostics , Conversion conversion , SyntaxNodeOrToken node , bool hasBaseReceiver )
530538 {
531539 if ( conversion . IsValid && ( object ) conversion . Method != null )
532540 {
@@ -600,6 +608,21 @@ internal static void ReportDiagnosticsIfObsolete(
600608 }
601609 }
602610
611+ internal static void ReportDiagnosticsIfObsolete (
612+ BindingDiagnosticBag diagnostics ,
613+ Symbol symbol ,
614+ SyntaxNodeOrToken node ,
615+ bool hasBaseReceiver ,
616+ Symbol containingMember ,
617+ NamedTypeSymbol containingType ,
618+ BinderFlags location )
619+ {
620+ if ( diagnostics . DiagnosticBag is object )
621+ {
622+ ReportDiagnosticsIfObsolete ( diagnostics . DiagnosticBag , symbol , node , hasBaseReceiver , containingMember , containingType , location ) ;
623+ }
624+ }
625+
603626 internal static ObsoleteDiagnosticKind ReportDiagnosticsIfObsoleteInternal ( DiagnosticBag diagnostics , Symbol symbol , SyntaxNodeOrToken node , Symbol containingMember , BinderFlags location )
604627 {
605628 Debug . Assert ( diagnostics != null ) ;
@@ -626,29 +649,37 @@ internal static ObsoleteDiagnosticKind ReportDiagnosticsIfObsoleteInternal(Diagn
626649 return kind ;
627650 }
628651
652+ internal static void ReportDiagnosticsIfObsoleteInternal ( BindingDiagnosticBag diagnostics , Symbol symbol , SyntaxNodeOrToken node , Symbol containingMember , BinderFlags location )
653+ {
654+ if ( diagnostics . DiagnosticBag is object )
655+ {
656+ ReportDiagnosticsIfObsoleteInternal ( diagnostics . DiagnosticBag , symbol , node , containingMember , location ) ;
657+ }
658+ }
659+
629660 internal static bool IsSymbolAccessibleConditional (
630661 Symbol symbol ,
631662 AssemblySymbol within ,
632- ref HashSet < DiagnosticInfo > useSiteDiagnostics )
663+ ref CompoundUseSiteInfo < AssemblySymbol > useSiteInfo )
633664 {
634- return AccessCheck . IsSymbolAccessible ( symbol , within , ref useSiteDiagnostics ) ;
665+ return AccessCheck . IsSymbolAccessible ( symbol , within , ref useSiteInfo ) ;
635666 }
636667
637668 internal bool IsSymbolAccessibleConditional (
638669 Symbol symbol ,
639670 NamedTypeSymbol within ,
640- ref HashSet < DiagnosticInfo > useSiteDiagnostics ,
671+ ref CompoundUseSiteInfo < AssemblySymbol > useSiteInfo ,
641672 TypeSymbol throughTypeOpt = null )
642673 {
643- return this . Flags . Includes ( BinderFlags . IgnoreAccessibility ) || AccessCheck . IsSymbolAccessible ( symbol , within , ref useSiteDiagnostics , throughTypeOpt ) ;
674+ return this . Flags . Includes ( BinderFlags . IgnoreAccessibility ) || AccessCheck . IsSymbolAccessible ( symbol , within , ref useSiteInfo , throughTypeOpt ) ;
644675 }
645676
646677 internal bool IsSymbolAccessibleConditional (
647678 Symbol symbol ,
648679 NamedTypeSymbol within ,
649680 TypeSymbol throughTypeOpt ,
650681 out bool failedThroughTypeCheck ,
651- ref HashSet < DiagnosticInfo > useSiteDiagnostics ,
682+ ref CompoundUseSiteInfo < AssemblySymbol > useSiteInfo ,
652683 ConsList < TypeSymbol > basesBeingResolved = null )
653684 {
654685 if ( this . Flags . Includes ( BinderFlags . IgnoreAccessibility ) )
@@ -657,7 +688,7 @@ internal bool IsSymbolAccessibleConditional(
657688 return true ;
658689 }
659690
660- return AccessCheck . IsSymbolAccessible ( symbol , within , throughTypeOpt , out failedThroughTypeCheck , ref useSiteDiagnostics , basesBeingResolved ) ;
691+ return AccessCheck . IsSymbolAccessible ( symbol , within , throughTypeOpt , out failedThroughTypeCheck , ref useSiteInfo , basesBeingResolved ) ;
661692 }
662693
663694 /// <summary>
@@ -666,8 +697,7 @@ internal bool IsSymbolAccessibleConditional(
666697 internal static void ReportUseSiteDiagnosticForSynthesizedAttribute (
667698 CSharpCompilation compilation ,
668699 WellKnownMember attributeMember ,
669- bool recordUsage ,
670- DiagnosticBag diagnostics ,
700+ BindingDiagnosticBag diagnostics ,
671701 Location location = null ,
672702 CSharpSyntaxNode syntax = null )
673703 {
@@ -677,7 +707,7 @@ internal static void ReportUseSiteDiagnosticForSynthesizedAttribute(
677707 // (comes from an unified assembly). When the symbol is not found no error is reported. See test VersionUnification_UseSiteDiagnostics_OptionalAttributes.
678708 bool isOptional = WellKnownMembers . IsSynthesizedAttributeOptional ( attributeMember ) ;
679709
680- GetWellKnownTypeMember ( compilation , attributeMember , recordUsage , diagnostics , location , syntax , isOptional ) ;
710+ GetWellKnownTypeMember ( compilation , attributeMember , diagnostics , location , syntax , isOptional ) ;
681711 }
682712
683713#if DEBUG
0 commit comments