Skip to content

Commit 580ac03

Browse files
Revert
1 parent 2857ec6 commit 580ac03

39 files changed

+56
-56
lines changed

src/Compilers/CSharp/Portable/Binder/Binder_Conversions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2464,7 +2464,7 @@ private BoundExpression CreateTupleLiteralConversion(SyntaxNode syntax, BoundTup
24642464
locationBuilder.Add(argument.NameColon?.Name.Location);
24652465
}
24662466

2467-
targetType = targetType.WithElementNames(sourceTuple.ArgumentNamesOpt,
2467+
targetType = targetType.WithElementNames(sourceTuple.ArgumentNamesOpt!,
24682468
locationBuilder.ToImmutableAndFree(),
24692469
errorPositions: default,
24702470
ImmutableArray.Create(tupleSyntax.Location));

src/Compilers/CSharp/Portable/Binder/Binder_Deconstruct.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ private BoundBadExpression MissingDeconstruct(BoundExpression receiver, SyntaxNo
717717
{
718718
if (receiver.Type?.IsErrorType() == false)
719719
{
720-
Error(diagnostics, ErrorCode.ERR_MissingDeconstruct, rightSyntax, receiver.Type, numParameters);
720+
Error(diagnostics, ErrorCode.ERR_MissingDeconstruct, rightSyntax, receiver.Type!, numParameters);
721721
}
722722

723723
outPlaceholders = default;

src/Compilers/CSharp/Portable/Binder/BindingDiagnosticBag.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ void addAssembliesUsedByNamespaceReferenceImpl(NamespaceSymbol ns)
140140

141141
if (containingAssembly?.IsMissing == false)
142142
{
143-
DependenciesBag.Add(containingAssembly);
143+
DependenciesBag!.Add(containingAssembly);
144144
}
145145
}
146146
}
@@ -162,7 +162,7 @@ internal CSDiagnosticInfo Add(ErrorCode code, SyntaxNode syntax, params object[]
162162
=> Add(code, syntax.Location, args);
163163

164164
internal CSDiagnosticInfo Add(ErrorCode code, SyntaxToken syntax, params object[] args)
165-
=> Add(code, syntax.GetLocation(), args);
165+
=> Add(code, syntax.GetLocation()!, args);
166166

167167
internal CSDiagnosticInfo Add(ErrorCode code, Location location, params object[] args)
168168
{

src/Compilers/CSharp/Portable/Binder/RefSafetyAnalysis.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ private void VisitArgumentsAndGetArgumentPlaceholders(BoundExpression? receiverO
764764
{
765765
visitArguments(nodeAndInvocationInfo.call, in nodeAndInvocationInfo.methodInvocationInfo);
766766
}
767-
while (calls.TryPop(out nodeAndInvocationInfo));
767+
while (calls.TryPop(out nodeAndInvocationInfo!));
768768

769769
calls.Free();
770770
}

src/Compilers/CSharp/Portable/BoundTree/LengthBasedStringSwitchData.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,15 +273,15 @@ public string Dump()
273273
{
274274
builder.AppendLine($"Label {readable(charJumpTable.Label)}:");
275275
builder.AppendLine($" Selected char position: {charJumpTable.SelectedCharPosition}:");
276-
dump(charJumpTable.CharCaseLabels);
276+
dump(charJumpTable.CharCaseLabels!);
277277
}
278278
builder.AppendLine();
279279

280280
builder.AppendLine("String dispatches:");
281281
foreach (var stringJumpTable in StringBasedJumpTables)
282282
{
283283
builder.AppendLine($"Label {readable(stringJumpTable.Label)}:");
284-
dump(stringJumpTable.StringCaseLabels);
284+
dump(stringJumpTable.StringCaseLabels!);
285285
}
286286
builder.AppendLine();
287287

src/Compilers/CSharp/Portable/Lowering/DiagnosticsPass_ExpressionTrees.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public override BoundNode VisitArrayAccess(BoundArrayAccess node)
9090
{
9191
if (_inExpressionLambda &&
9292
node.Indices.Length == 1 &&
93-
!node.Indices[0].Type.SpecialType.CanOptimizeBehavior())
93+
!node.Indices[0].Type!.SpecialType.CanOptimizeBehavior())
9494
{
9595
Error(ErrorCode.ERR_ExpressionTreeContainsPatternImplicitIndexer, node);
9696
}

src/Compilers/CSharp/Portable/Symbols/NamedTypeSymbol.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ internal abstract partial class NamedTypeSymbol : TypeSymbol, INamedTypeSymbolIn
2626
{
2727
private bool _hasNoBaseCycles;
2828

29-
private static readonly ImmutableSegmentedDictionary<string, Symbol> RequiredMembersErrorSentinel = ImmutableSegmentedDictionary<string, Symbol>.Empty.Add("<error sentinel>", null);
29+
private static readonly ImmutableSegmentedDictionary<string, Symbol> RequiredMembersErrorSentinel = ImmutableSegmentedDictionary<string, Symbol>.Empty.Add("<error sentinel>", null!);
3030

3131
/// <summary>
3232
/// <see langword="default"/> if uninitialized. <see cref="RequiredMembersErrorSentinel"/> if there are errors. <see cref="ImmutableSegmentedDictionary{TKey, TValue}.Empty"/> if

src/Compilers/CSharp/Portable/Symbols/ReferenceManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ private bool CreateAndSetSourceAssemblyFullBind(CSharpCompilation compilation)
505505
implicitReferenceResolutions,
506506
hasCircularReference,
507507
resolutionDiagnostics.ToReadOnly(),
508-
ReferenceEquals(corLibrary, assemblySymbol) ? null : corLibrary, // https://github.com/dotnet/roslyn/issues/40751 Unnecessary suppression
508+
ReferenceEquals(corLibrary, assemblySymbol) ? null! : corLibrary, // https://github.com/dotnet/roslyn/issues/40751 Unnecessary suppression
509509
modules,
510510
moduleReferences,
511511
assemblySymbol.SourceModule.GetReferencedAssemblySymbols(),

src/Compilers/CSharp/Portable/Symbols/Source/SourceMemberContainerSymbol.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3535,7 +3535,7 @@ public void Free()
35353535
AddDeclarationDiagnostics(diagnostics);
35363536
diagnostics.Free();
35373537

3538-
return declaredMembersAndInitializers;
3538+
return declaredMembersAndInitializers!;
35393539
}
35403540

35413541
// Builds explicitly declared members (as opposed to synthesized members).

src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedEntryPointSymbol.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ internal AsyncForwardEntryPoint(CSharpCompilation compilation, NamedTypeSymbol c
373373
{ WasCompilerGenerated = true };
374374

375375
// The diagnostics that would be produced here will already have been captured and returned.
376-
var success = binder.GetAwaitableExpressionInfo(userMainInvocation, out _getAwaiterGetResultCall, runtimeAsyncAwaitCall: out _, _userMainReturnTypeSyntax, BindingDiagnosticBag.Discarded);
376+
var success = binder.GetAwaitableExpressionInfo(userMainInvocation, out _getAwaiterGetResultCall!, runtimeAsyncAwaitCall: out _, _userMainReturnTypeSyntax, BindingDiagnosticBag.Discarded);
377377

378378
Debug.Assert(
379379
ReturnType.IsVoidType() ||

0 commit comments

Comments
 (0)