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

Allow arbitrary catch clause type annotations #52280

Closed

Conversation

jakebailey
Copy link
Member

@jakebailey jakebailey commented Jan 17, 2023

Fixes #20024

Playground

This is a follow-up to #52240 to exercise my comment in #52240 (comment), pulled into a PR for design meeting demoing.

The actual change is db0c9b0 (i.e. deletions only!), the rest is #52240 as it's not merged in main.

This probably conflicts with #13219 somehow, but I expect that the code in #52240 and this PR that grabs the type for the catch clause would just be updated. That or if we do something like #51390 this should still compose (as it's just another "default" implicit annotation).

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Jan 17, 2023
@jakebailey jakebailey changed the title [experiment] Allow arbitrary catch clause type annotations Allow arbitrary catch clause type annotations Jan 17, 2023
@jakebailey
Copy link
Member Author

@typescript-bot pack this

@typescript-bot

This comment was marked as outdated.

@typescript-bot

This comment was marked as outdated.

@jakebailey jakebailey force-pushed the arbitrary-catch-clause-annotations branch from 9386f12 to db0c9b0 Compare January 17, 2023 22:37
@jakebailey
Copy link
Member Author

jakebailey commented Jan 17, 2023

Weird:
image

We have no test that exercises this; I guess the catch clause isn't taking part in code flow, somehow.

It only happens in tsserver, though......

@jakebailey jakebailey force-pushed the arbitrary-catch-clause-annotations branch from db0c9b0 to 64cc18f Compare January 18, 2023 19:02
@jakebailey
Copy link
Member Author

Semantic tokens! shakes fist

@jakebailey
Copy link
Member Author

@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 18, 2023

Heya @jakebailey, I've started to run the tarball bundle task on this PR at 4368a4a. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 18, 2023

Hey @jakebailey, I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
    "devDependencies": {
        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/142987/artifacts?artifactName=tgz&fileId=8976A24C1A928E71502339E84B0A8225C82B23FFC1FE8203D30CA0E938C0815C02&fileName=/typescript-5.0.0-insiders.20230118.tgz"
    }
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/pr-build@5.0.0-pr-52280-7".;

@jakebailey jakebailey force-pushed the arbitrary-catch-clause-annotations branch from 4368a4a to 516267c Compare January 18, 2023 20:57
@jakebailey
Copy link
Member Author

jakebailey commented Jan 18, 2023

I posted this because it was easy after #52240, but per design meeting it seems that this feature isn't palatable (which is totally fair!) especially in the context of upcoming ES pattern matching proposals; closing.

@jakebailey jakebailey closed this Jan 18, 2023
@jakebailey jakebailey deleted the arbitrary-catch-clause-annotations branch January 29, 2024 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow type annotation on catch clause variable
2 participants