Skip to content

Commit a6975e0

Browse files
Nullable annotation fixes (#82803)
* Nullable annotation fixes Once runtime merges to a Roslyn toolset that has the fix for [issue 50782](dotnet/roslyn#50782) these annotations will be necessary. Front loading the work here with this change. * Apply suggestions from code review Co-authored-by: Stephen Toub <[email protected]> --------- Co-authored-by: Stephen Toub <[email protected]>
1 parent 86a98e8 commit a6975e0

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/VersionConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public override bool IsValid(ITypeDescriptorContext? context, object? value)
9494
{
9595
if (value is string version)
9696
{
97-
return Version.TryParse(version, out Version _);
97+
return Version.TryParse(version, out _);
9898
}
9999
return value is Version;
100100
}

src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPoolManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ private void RemoveStalePools()
471471
{
472472
if (entry.Value.CleanCacheAndDisposeIfUnused())
473473
{
474-
_pools.TryRemove(entry.Key, out HttpConnectionPool _);
474+
_pools.TryRemove(entry.Key, out _);
475475
}
476476
}
477477

src/libraries/System.Private.CoreLib/src/System/TimeZoneInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ public static TimeZoneInfo CreateCustomTimeZone(
891891
string? displayName,
892892
string? standardDisplayName)
893893
{
894-
bool hasIanaId = TimeZoneInfo.TryConvertIanaIdToWindowsId(id, allocate: false, out string _);
894+
bool hasIanaId = TimeZoneInfo.TryConvertIanaIdToWindowsId(id, allocate: false, out _);
895895

896896
return new TimeZoneInfo(
897897
id,
@@ -942,7 +942,7 @@ public static TimeZoneInfo CreateCustomTimeZone(
942942
adjustmentRules = (AdjustmentRule[])adjustmentRules.Clone();
943943
}
944944

945-
bool hasIanaId = TimeZoneInfo.TryConvertIanaIdToWindowsId(id, allocate: false, out string _);
945+
bool hasIanaId = TimeZoneInfo.TryConvertIanaIdToWindowsId(id, allocate: false, out _);
946946

947947
return new TimeZoneInfo(
948948
id,

src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataContractSet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ internal IEnumerator<KeyValuePair<XmlQualifiedName, DataContract>> GetEnumerator
650650
public void ImportSchemaSet(XmlSchemaSet schemaSet, IEnumerable<XmlQualifiedName>? typeNames, bool importXmlDataType)
651651
{
652652
SchemaImporter importer = new SchemaImporter(schemaSet, typeNames, null, this, importXmlDataType);
653-
importer.Import(out List<XmlQualifiedName> _);
653+
importer.Import(out _);
654654
}
655655

656656
[RequiresDynamicCode(DataContract.SerializerAOTWarning)]

src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/Parameters/Ecma/EcmaFatMethodParameter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ internal EcmaFatMethodParameter(IRoMethodBase roMethodBase, int position, Type p
3737

3838
protected sealed override IEnumerable<CustomAttributeData> GetTrueCustomAttributes() => Parameter.GetCustomAttributes().ToTrueCustomAttributes(GetEcmaModule());
3939

40-
public sealed override bool HasDefaultValue => TryGetRawDefaultValue(out object _);
40+
public sealed override bool HasDefaultValue => TryGetRawDefaultValue(out _);
4141

4242
public sealed override object? RawDefaultValue
4343
{

0 commit comments

Comments
 (0)