Referencing type members as a MemberInfo instance #8240
Unanswered
hermankan
asked this question in
Language Ideas
Replies: 2 comments 3 replies
-
How would these implicit conversion operator-like things work when overloads exist? What is this supposed to do? ConstructorInfo ci = Foo;
public class Foo
{
public Foo(int a) { }
public Foo(string a) { }
} |
Beta Was this translation helpful? Give feedback.
2 replies
-
See: #712 "In Foof We Trust" |
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.
Uh oh!
There was an error while loading. Please reload this page.
-
For the following class
Foo
and methodBar
:allow referencing the class members as follows:
Likewise, referencing
Foo
could be a shorthand notation oftypeof(Foo)
:This would be compile-time safe, more concise and straightforward than the current ways:
I would imagine use cases where reflection is heavily used like this:
Beta Was this translation helpful? Give feedback.
All reactions