Target-typed static member access #2254
Unanswered
tmat
asked this question in
Language Ideas
Replies: 2 comments
-
|
Beta Was this translation helpful? Give feedback.
0 replies
-
@TheUnlocked It's more consistent to think of |
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.
Uh oh!
There was an error while loading. Please reload this page.
-
I have recently encountered the following scenario:
Creating an instance of the
ProjectChanges
class with empty arrays requires a lot of typing:If I wanted to allow null arrays I could write
But I want those arrays to be non-nullable.
It would be handy if we could express the target type of an expression. For example,
Accessing member off of
default
keyword currently disallowed:So the compiler could potentially interpret
default
as a type, which can be used to access static members.Beta Was this translation helpful? Give feedback.
All reactions