Skip to content

Commit 71e720e

Browse files
authored
Merge pull request #46176 from 333fred/update-references
2 parents 53b2957 + b22ae3a commit 71e720e

File tree

32 files changed

+63
-33
lines changed

32 files changed

+63
-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
@@ -1520,7 +1520,7 @@ private void CheckMemberNameConflicts(DiagnosticBag diagnostics)
15201520
foreach (var pair in membersByName)
15211521
{
15221522
var name = pair.Key;
1523-
Symbol lastSym = GetTypeMembers(name).FirstOrDefault();
1523+
Symbol? lastSym = GetTypeMembers(name).FirstOrDefault();
15241524
methodsBySignature.Clear();
15251525
// Conversion collisions do not consider the name of the conversion,
15261526
// so do not clear that dictionary.
@@ -1567,7 +1567,7 @@ private void CheckMemberNameConflicts(DiagnosticBag diagnostics)
15671567
// following a field of the same name, or a field and a nested type of the same name.
15681568
//
15691569

1570-
if ((object)lastSym != null)
1570+
if ((object?)lastSym != null)
15711571
{
15721572
if (symbol.Kind != SymbolKind.Method || lastSym.Kind != SymbolKind.Method)
15731573
{

src/Compilers/Core/CodeAnalysisTest/Analyzers/AnalyzerFileReferenceAppDomainTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ public class TestAnalyzer : DiagnosticAnalyzer
9191
new SyntaxTree[] { CSharp.SyntaxFactory.ParseSyntaxTree(analyzerSource) },
9292
new MetadataReference[]
9393
{
94+
TestMetadata.NetStandard20.mscorlib,
9495
TestMetadata.NetStandard20.netstandard,
9596
TestMetadata.NetStandard20.SystemRuntime,
9697
MetadataReference.CreateFromFile(immutable.Path),

src/Compilers/Core/CodeAnalysisTest/ShadowCopyAnalyzerAssemblyLoaderTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public abstract class AbstractTestAnalyzer : DiagnosticAnalyzer
5757
new SyntaxTree[] { CSharp.SyntaxFactory.ParseSyntaxTree(analyzerDependencySource) },
5858
new MetadataReference[]
5959
{
60+
TestMetadata.NetStandard20.mscorlib,
6061
TestMetadata.NetStandard20.netstandard,
6162
TestMetadata.NetStandard20.SystemRuntime,
6263
MetadataReference.CreateFromFile(immutable.Path),
@@ -83,6 +84,7 @@ public sealed class TestAnalyzer : AbstractTestAnalyzer
8384
new SyntaxTree[] { CSharp.SyntaxFactory.ParseSyntaxTree(analyzerMainSource) },
8485
new MetadataReference[]
8586
{
87+
TestMetadata.NetStandard20.mscorlib,
8688
TestMetadata.NetStandard20.netstandard,
8789
TestMetadata.NetStandard20.SystemRuntime,
8890
MetadataReference.CreateFromFile(immutable.Path),

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
}

0 commit comments

Comments
 (0)