Add more dynamic feature to make reflection more easily #7613
Unanswered
wherewhere
asked this question in
Language Ideas
Replies: 1 comment 2 replies
-
I don't think dynamic feature is encouraged or actively developed. What is the real scenario to use reflection when the exact steps to call are already known? Accessing excessive internal code? |
Beta Was this translation helpful? Give feedback.
2 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.
-
For example, if we need to start a process by reflection, we need to write a long code like this.
We need write a lot to create an instance and invoke a static method. So shall we simplify it like:
typeof[string]
, liketypeof(T)
, can get a type by the name of type. the[]
meens it like an index to index a type from all the types. For example:Then we can add more feature of
Type
. For example:We can also have
default[Type]
to get the default instance of target type,nameof[Type]
to get the name of target type andsizeof[Type]
to get the size of target type.Beta Was this translation helpful? Give feedback.
All reactions