@@ -1069,6 +1069,7 @@ private bool HasCollectionInitializerTypeInProgress(SyntaxNode syntax, TypeSymbo
10691069 ReportDiagnosticsIfObsolete ( diagnostics , collectionBuilderMethod . ContainingType , syntax , hasBaseReceiver : false ) ;
10701070 ReportDiagnosticsIfObsolete ( diagnostics , collectionBuilderMethod , syntax , hasBaseReceiver : false ) ;
10711071 ReportDiagnosticsIfUnmanagedCallersOnly ( diagnostics , collectionBuilderMethod , syntax , isDelegateConversion : false ) ;
1072+ Debug . Assert ( ! collectionBuilderMethod . GetIsNewExtensionMember ( ) ) ;
10721073
10731074 return collectionBuilderMethod ;
10741075 }
@@ -1430,11 +1431,14 @@ static bool bindMethodGroupInvocation(
14301431 {
14311432 addMethodBinder . ReportDiagnosticsIfObsolete ( diagnostics , addMethods [ 0 ] , syntax , hasBaseReceiver : false ) ;
14321433 ReportDiagnosticsIfUnmanagedCallersOnly ( diagnostics , addMethods [ 0 ] , syntax , isDelegateConversion : false ) ;
1434+ Debug . Assert ( ! IsDisallowedExtensionInOlderLangVer ( addMethods [ 0 ] ) ) ;
14331435 }
14341436 }
14351437 }
14361438 else
14371439 {
1440+ Debug . Assert ( ! resolution . OverloadResolutionResult . Succeeded ) ;
1441+
14381442 result = bindInvocationExpressionContinued (
14391443 addMethodBinder , syntax , expression , resolution . OverloadResolutionResult , resolution . AnalyzedArguments ,
14401444 resolution . MethodGroup , diagnostics : diagnostics , out var addMethod ) ;
@@ -1622,6 +1626,7 @@ static bool bindInvocationExpressionContinued(
16221626
16231627 addMethodBinder . ReportDiagnosticsIfObsolete ( diagnostics , method , node , hasBaseReceiver : false ) ;
16241628 ReportDiagnosticsIfUnmanagedCallersOnly ( diagnostics , method , node , isDelegateConversion : false ) ;
1629+ ReportDiagnosticsIfDisallowedExtension ( diagnostics , method , node ) ;
16251630
16261631 // No use site errors, but there could be use site warnings.
16271632 // If there are any use site warnings, they have already been reported by overload resolution.
@@ -3051,6 +3056,7 @@ private bool MethodGroupConversionHasErrors(
30513056 ReportDiagnosticsIfUnmanagedCallersOnly ( diagnostics , selectedMethod , syntax , isDelegateConversion : true ) ;
30523057 }
30533058 ReportDiagnosticsIfObsolete ( diagnostics , selectedMethod , syntax , hasBaseReceiver : false ) ;
3059+ ReportDiagnosticsIfDisallowedExtension ( diagnostics , selectedMethod , syntax ) ;
30543060
30553061 // No use site errors, but there could be use site warnings.
30563062 // If there are use site warnings, they were reported during the overload resolution process
0 commit comments