Shortcut keyword for current class type #4752
Unanswered
natehitze
asked this question in
Language Ideas
Replies: 1 comment
-
See #252 |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
I have a fair amount of code like this:
or another example:
It would be nice if there was a keyword to replace the
FooController
bit of that inside the class. Something like this:or
The (admittedly small) value here is having a compile time check for referencing a class's own type. An issue with using
ILogger<T>
is that you can accidentally log for a different category (e.g. DI anILogger<BarController>
inFooController
) and you can't catch it without an analyzer right now.Beta Was this translation helpful? Give feedback.
All reactions