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

add support of TS 4.7 Instantiation Expression #2038

Merged
merged 1 commit into from Mar 10, 2022
Merged

add support of TS 4.7 Instantiation Expression #2038

merged 1 commit into from Mar 10, 2022

Conversation

g-plane
Copy link
Contributor

@g-plane g-plane commented Feb 21, 2022

This PR added support of TypeScript 4.7 Instantiation Expression.

@evanw
Copy link
Owner

evanw commented Feb 25, 2022

Their example code doesn't appear to work on TypeScript nightly builds because the compiler considers it a syntax error:

function makeBox<T>(value: T) {
    return { value };
};

const makeStringBox = makeBox<string>;  // (value: string) => { value: string }
const stringBox = makeStringBox('abc');  // { value: string }

const ErrorMap = Map<string, Error>;  // new () => Map<string, Error>
const errorMap = new ErrorMap();  // Map<string, Error>

I don't think we should land this before that happens. Sometimes the TypeScript team lands features and then reverts them. I wonder if that's what happened here?

@g-plane
Copy link
Contributor Author

g-plane commented Feb 26, 2022

This feature shouldn't be reverted by TS team, but yes, it's still in nightly, so we can wait for the next TS beta then merge this PR.

@AlCalzone
Copy link

It no longer is a syntax error in the playground now.

@evanw evanw merged commit 5b782b6 into evanw:master Mar 10, 2022
evanw added a commit that referenced this pull request Mar 10, 2022
zhusjfaker pushed a commit to speedy-js/esbuild that referenced this pull request Mar 28, 2022
zhusjfaker pushed a commit to speedy-js/esbuild that referenced this pull request Mar 28, 2022
hardfist pushed a commit to speedy-js/esbuild that referenced this pull request Mar 28, 2022
hardfist pushed a commit to speedy-js/esbuild that referenced this pull request Mar 28, 2022
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

3 participants