-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reflection Support for Types and Other Constructs #49610
Comments
Duplicate of #3628.
It does not agree with the TypeScript Design Goals. See non-goal 5, which mentions this explicitly.
|
With all due respect, that's not a wise philosophy. Restricting developers in what they can do is antithetical to |
Non-support of reflection is an intentional design goal; you're free to disagree with that but we've found it to work well so far. |
@RyanCavanaugh What possible goal does intentional non-support of reflection have other than to harm the utility of the language? |
Great question; not making the types of your program part of your runtime contract means we can do semantics-preserving type representation changes between releases (such as going from |
Ah, so is this something where reflection is being saved for when |
I don't think we'll ever stop innovating in the type system; it's where the value is. The future is far away and if things change we will of course re-evaluate. Meanwhile, projects like |
Suggestion
The specific issue I'm running in to relates to reflection on
TypeScript
type
constructs, specifically with:I would like to be able to discern:
In a more general sense,
TypeScript
is sorely lacking in a lot of reflection functionality, to the point getting a similar result from anenum
looks something like:It would be nice if
TypeScript
supportedreflection
with 100% coverage to the point of.NET
without all the hacks to work around it and the duplicate-code/boilerplate required when reflection simply isn't possible, such as in the case oftype
constructs.🔍 Search Terms
Reflection, Types
✅ Viability Checklist
⭐ Suggestion
.NET
-tier reflection.📃 Motivating Example
See above.
💻 Use Cases
See above.
The text was updated successfully, but these errors were encountered: