Extensions with constrained generic types are not recommended when invoked on a generic method parameter #72457
Labels
Area-IDE
Bug
help wanted
The issue is "up for grabs" - add a comment if you are interested in working on it
Milestone
Versions Used
VS 2022 Version 17.9.2
Roslyn 4.9.0 (a98c90d)
VS 2022 Version 17.10.0 Preview 1
Roslyn 4.10.0 (fa72fa6)
Project info
C# 12.0
.NET 8.0
Steps to Reproduce
this
parameter is a generic type parameter from the extension methodA relatively long code snippet is found on SharpLab, showing multiple cases of failing to suggest valid extensions. Try typing the names of the extensions anew to notice the lack of the suggestion.
Expected Behavior
All generic extension methods that have their generic type parameter constraints met are recommended.
Actual Behavior
Only unconstrained generic methods are recommended. When a desired generic extension method is manually typed, it is properly recognized and no error is reported.
The text was updated successfully, but these errors were encountered: