Skip to content

Commit 3667c3f

Browse files
committed
Bump versions of System.Collections.Immutable and System.Reflection.Metadata to consume the new function pointer metadata changes.
1 parent d025e59 commit 3667c3f

File tree

29 files changed

+59
-33
lines changed

29 files changed

+59
-33
lines changed

eng/Versions.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,8 @@
252252
-->
253253
<NewtonsoftJsonVersion>12.0.2</NewtonsoftJsonVersion>
254254
<StreamJsonRpcVersion>2.4.34</StreamJsonRpcVersion>
255-
<SystemCollectionsImmutableVersion>1.5.0</SystemCollectionsImmutableVersion>
256-
<SystemReflectionMetadataVersion>1.6.0</SystemReflectionMetadataVersion>
255+
<SystemCollectionsImmutableVersion>5.0.0-preview.8.20371.14</SystemCollectionsImmutableVersion>
256+
<SystemReflectionMetadataVersion>5.0.0-preview.8.20371.14</SystemReflectionMetadataVersion>
257257
<MicrosoftVisualStudioStaticReviewsEmbeddableVersion>0.1.102-alpha</MicrosoftVisualStudioStaticReviewsEmbeddableVersion>
258258
<MicrosoftBclAsyncInterfacesVersion>1.1.0</MicrosoftBclAsyncInterfacesVersion>
259259
</PropertyGroup>

src/Analyzers/Core/Analyzers/RemoveUnnecessarySuppressions/AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ private ImmutableHashSet<int> GetSupportedCompilerErrorCodes()
6060
var methodInfo = compilerAnalyzerType.GetMethod("GetSupportedErrorCodes", BindingFlags.Instance | BindingFlags.NonPublic)!;
6161
var compilerAnalyzerInstance = Activator.CreateInstance(compilerAnalyzerType);
6262
var supportedCodes = methodInfo.Invoke(compilerAnalyzerInstance, Array.Empty<object>()) as IEnumerable<int>;
63-
return supportedCodes.ToImmutableHashSet();
63+
return supportedCodes?.ToImmutableHashSet() ?? ImmutableHashSet<int>.Empty;
6464
}
6565
catch (Exception ex)
6666
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,7 @@ private static (
10051005
}
10061006
IValueSet fromTestPassing = valueFac.Related(relation.Operator(), value);
10071007
IValueSet fromTestFailing = fromTestPassing.Complement();
1008-
if (values.TryGetValue(test.Input, out IValueSet tempValuesBeforeTest))
1008+
if (values.TryGetValue(test.Input, out IValueSet? tempValuesBeforeTest))
10091009
{
10101010
fromTestPassing = fromTestPassing.Intersect(tempValuesBeforeTest);
10111011
fromTestFailing = fromTestFailing.Intersect(tempValuesBeforeTest);

src/Compilers/CSharp/Portable/Compilation/CSharpCompilation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3664,7 +3664,7 @@ void WriteValue(string key, string value)
36643664

36653665
private ImmutableArray<string> GetPreprocessorSymbols()
36663666
{
3667-
CSharpSyntaxTree firstTree = (CSharpSyntaxTree)SyntaxTrees.FirstOrDefault();
3667+
CSharpSyntaxTree? firstTree = (CSharpSyntaxTree?)SyntaxTrees.FirstOrDefault();
36683668

36693669
if (firstTree is null)
36703670
{

src/Compilers/CSharp/Portable/Compilation/MemberSemanticModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ private T GetRemappedSymbol<T>(T originalSymbol) where T : Symbol
704704
EnsureNullabilityAnalysisPerformedIfNecessary();
705705
if (_lazyRemappedSymbols is null) return originalSymbol;
706706

707-
if (_lazyRemappedSymbols.TryGetValue(originalSymbol, out Symbol remappedSymbol))
707+
if (_lazyRemappedSymbols.TryGetValue(originalSymbol, out Symbol? remappedSymbol))
708708
{
709709
RoslynDebug.Assert(remappedSymbol is object);
710710
return (T)remappedSymbol;

src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker.SnapshotManager.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.Collections.Generic;
77
using System.Collections.Immutable;
88
using System.Diagnostics;
9+
using System.Diagnostics.CodeAnalysis;
910
using Microsoft.CodeAnalysis.CSharp.Symbols;
1011
using Microsoft.CodeAnalysis.PooledObjects;
1112
using Roslyn.Utilities;
@@ -98,7 +99,7 @@ private SnapshotManager(ImmutableArray<SharedWalkerState> walkerSharedStates, Im
9899
return null;
99100
}
100101

101-
internal bool TryGetUpdatedSymbol(BoundNode node, Symbol symbol, out Symbol updatedSymbol)
102+
internal bool TryGetUpdatedSymbol(BoundNode node, Symbol symbol, [NotNullWhen(true)] out Symbol? updatedSymbol)
102103
{
103104
return _updatedSymbolsMap.TryGetValue((node, symbol), out updatedSymbol);
104105
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,7 +1514,7 @@ private void CheckMemberNameConflicts(DiagnosticBag diagnostics)
15141514
foreach (var pair in membersByName)
15151515
{
15161516
var name = pair.Key;
1517-
Symbol lastSym = GetTypeMembers(name).FirstOrDefault();
1517+
Symbol? lastSym = GetTypeMembers(name).FirstOrDefault();
15181518
methodsBySignature.Clear();
15191519
// Conversion collisions do not consider the name of the conversion,
15201520
// so do not clear that dictionary.
@@ -1561,7 +1561,7 @@ private void CheckMemberNameConflicts(DiagnosticBag diagnostics)
15611561
// following a field of the same name, or a field and a nested type of the same name.
15621562
//
15631563

1564-
if ((object)lastSym != null)
1564+
if ((object?)lastSym != null)
15651565
{
15661566
if (symbol.Kind != SymbolKind.Method || lastSym.Kind != SymbolKind.Method)
15671567
{

src/Compilers/Core/Portable/Collections/StaticCast.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ internal static class StaticCast<T>
1212
{
1313
internal static ImmutableArray<T> From<TDerived>(ImmutableArray<TDerived> from) where TDerived : class?, T
1414
{
15+
// Remove the pragma when we get a version with https://github.com/dotnet/runtime/issues/39799 fixed
16+
#pragma warning disable CS8634
1517
return ImmutableArray<T>.CastUp(from);
18+
#pragma warning restore CS8634
1619
}
1720
}
1821
}

src/Compilers/Core/Portable/CommandLine/AnalyzerConfig.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public sealed partial class AnalyzerConfig
8383
/// <summary>
8484
/// Gets whether this editorconfig is a topmost editorconfig.
8585
/// </summary>
86-
internal bool IsRoot => GlobalSection.Properties.TryGetValue("root", out string val) && val == "true";
86+
internal bool IsRoot => GlobalSection.Properties.TryGetValue("root", out string? val) && val == "true";
8787

8888
/// <summary>
8989
/// Gets whether this editorconfig is a global editorconfig.

src/Compilers/Core/Portable/DiagnosticAnalyzer/AnalysisResult.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ private static void AddLocalDiagnostics<T>(
114114
ImmutableDictionary<T, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localDiagnostics,
115115
ImmutableHashSet<DiagnosticAnalyzer> excludedAnalyzers,
116116
ImmutableArray<Diagnostic>.Builder builder)
117+
where T : notnull
117118
{
118119
foreach (var diagnosticsByTree in localDiagnostics)
119120
{

0 commit comments

Comments
 (0)