Discussion: static reflection #506
Unanswered
alrz
asked this question in
Language Ideas
Replies: 0 comments
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.
-
In dotnet/roslyn#10972 it's proposed to turn some of
typeof(T)
properties to a compile-time constant, for instance:typeof(T).Namespace
so that it does not incur runtime overhead.If we intend to extend this beyond primitive properties like
Namespace
orName
, we should construct a uniqueSystem.Reflection.TypeInfo
orSystem.Reflection.IReflectedType
for each "reflected type" with a compiler-provided type-specific implementation. In that case, we may not be able to use the existingtypeof
syntax though. See also: www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0590r0.pdfBeta Was this translation helpful? Give feedback.
All reactions