Skip to content

Commit

Permalink
Nullable annotation fixes (#82803)
Browse files Browse the repository at this point in the history
* 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 <stoub@microsoft.com>

---------

Co-authored-by: Stephen Toub <stoub@microsoft.com>
  • Loading branch information
jaredpar and stephentoub authored Mar 3, 2023
1 parent 86a98e8 commit a6975e0
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public override bool IsValid(ITypeDescriptorContext? context, object? value)
{
if (value is string version)
{
return Version.TryParse(version, out Version _);
return Version.TryParse(version, out _);
}
return value is Version;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ private void RemoveStalePools()
{
if (entry.Value.CleanCacheAndDisposeIfUnused())
{
_pools.TryRemove(entry.Key, out HttpConnectionPool _);
_pools.TryRemove(entry.Key, out _);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ public static TimeZoneInfo CreateCustomTimeZone(
string? displayName,
string? standardDisplayName)
{
bool hasIanaId = TimeZoneInfo.TryConvertIanaIdToWindowsId(id, allocate: false, out string _);
bool hasIanaId = TimeZoneInfo.TryConvertIanaIdToWindowsId(id, allocate: false, out _);

return new TimeZoneInfo(
id,
Expand Down Expand Up @@ -942,7 +942,7 @@ public static TimeZoneInfo CreateCustomTimeZone(
adjustmentRules = (AdjustmentRule[])adjustmentRules.Clone();
}

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

return new TimeZoneInfo(
id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ internal IEnumerator<KeyValuePair<XmlQualifiedName, DataContract>> GetEnumerator
public void ImportSchemaSet(XmlSchemaSet schemaSet, IEnumerable<XmlQualifiedName>? typeNames, bool importXmlDataType)
{
SchemaImporter importer = new SchemaImporter(schemaSet, typeNames, null, this, importXmlDataType);
importer.Import(out List<XmlQualifiedName> _);
importer.Import(out _);
}

[RequiresDynamicCode(DataContract.SerializerAOTWarning)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ internal EcmaFatMethodParameter(IRoMethodBase roMethodBase, int position, Type p

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

public sealed override bool HasDefaultValue => TryGetRawDefaultValue(out object _);
public sealed override bool HasDefaultValue => TryGetRawDefaultValue(out _);

public sealed override object? RawDefaultValue
{
Expand Down

0 comments on commit a6975e0

Please sign in to comment.