mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
disable warning CA1062 by using C#8 beta nullable ref types
https://github.com/MicrosoftDocs/visualstudio-docs/issues/3588
This commit is contained in:
parent
1611b53a0f
commit
2892cd655a
3 changed files with 5 additions and 4 deletions
|
|
@ -7,9 +7,7 @@ public static class ReadOnlyListExtensions
|
|||
{
|
||||
public static T FirstOrDefault<T>(this IReadOnlyList<T> list)
|
||||
{
|
||||
if (list is null)
|
||||
throw new ArgumentNullException(nameof(list));
|
||||
return list.Count == 0 ? default : list[0];
|
||||
return list.Count == 0 ? default! : list[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4,7 +4,9 @@
|
|||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<LangVersion>8.0</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<NullableContextOptions>enable</NullableContextOptions>
|
||||
<Authors>Collin M. Barrett</Authors>
|
||||
<Company>Collin M. Barrett</Company>
|
||||
<Product>FilterLists</Product>
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
<Rule Id="CA1049" Action="Warning" />
|
||||
<Rule Id="CA1060" Action="Warning" />
|
||||
<Rule Id="CA1061" Action="Warning" />
|
||||
<Rule Id="CA1062" Action="None" />
|
||||
<Rule Id="CA1063" Action="Warning" />
|
||||
<Rule Id="CA1065" Action="Warning" />
|
||||
<Rule Id="CA1301" Action="Warning" />
|
||||
|
|
|
|||
Loading…
Reference in a new issue