Skip to content
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

feat: downlevel type arguments in typeof #83

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

davidyuk
Copy link

No description provided.


```ts
type N = any;
```
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm struggling to write a good semantics part, not sure about the chosen approach

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current architecture of downlevel-dts is syntax-only so it doesn't have the information to make this work. If the tool had type information, it could use an inlining strategy: write out the signature type after instantiation.

Constructing a full program to collection type information would make downlevel-dts much slower and more fragile. So I think it's better not to downlevel this construction.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... and to avoid usage of typeof foo<T> in the original code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants