-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Area-IDEBugFeature - Nullable Reference TypesNullable Reference TypesNullable Reference Typeshelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on itThe issue is "up for grabs" - add a comment if you are interested in working on it
Milestone
Description
Version Used: 16.6.2
No diagnostic should be shown here. The name cannot be simplified without adding at least two ! suppressions due to the choice of a generic type argument (string?) that would not make sense to choose here in the first place.
_ denotes a faded span.
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
#nullable enable
class C
{
bool M(IEnumerable<string> s, [NotNullWhen(true)] out string? result)
{
// ℹ IDE0001 "Name can be simplified. Type argument specification is redundant."
// 💡 Simplify name 'TryFirst<string>'
// ________
return s.TryFirst<string>(x => x.Length % 2 == 0, out result);
}
}
static class Extensions
{
public static bool TryFirst<T>(this IEnumerable<T> source, Func<T, bool> predicate, [MaybeNullWhen(false)] out T value)
{
throw new NotImplementedException();
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area-IDEBugFeature - Nullable Reference TypesNullable Reference TypesNullable Reference Typeshelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on itThe issue is "up for grabs" - add a comment if you are interested in working on it
Type
Projects
Status
Completed