nameof cant handle generic with constraint #5494
Unanswered
puschie286
asked this question in
General
Replies: 1 comment 1 reply
-
This doesn't appear to be wrong. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
nameof can be used for generic types - but it fails to access interfaces on generic types ( it ignores constraints on generic types ).
This works fine with the actual implementaion
dotnet fiddle: https://dotnetfiddle.net/2qIrI8
Configuration
Checked on .NET 6 and Roslyn 4.0
Other information
You can foward this to the implementation as a parameter
nameof( Implementation.Test )
Beta Was this translation helpful? Give feedback.
All reactions