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

Walk all outer expression kinds before comitting to the return type of a symbol call #61071

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

Conversation

Andarist
Copy link
Contributor

fixes #61070

@jakebailey
Copy link
Member

Doesn't walkUpOuterExpressions do things other than satisfies and parens?

@Andarist
Copy link
Contributor Author

Doesn't walkUpOuterExpressions do things other than satisfies and parens?

Yes, I could control what it is supposed to handle with a bitmask but I decided that there is no harm to just use the default (All). Cause at the end of the day - what harm can be caused by it? One of the changes would be a changed error like:

-const bar = Symbol() as string; // Conversion of type 'symbol' to type 'string' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.(2352)
+const bar = Symbol() as string; // Conversion of type 'typeof bar' to type 'string' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.(2352)

@RyanCavanaugh
Copy link
Member

@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 29, 2025

Starting jobs; this comment will be updated as builds start and complete.

Command Status Results
pack this ✅ Started ✅ Results

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 29, 2025

Hey @RyanCavanaugh, 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/164676/artifacts?artifactName=tgz&fileId=6AC0B4FA6225C679120D6D095ADE93E18CE2BB508C80F6B2148B4273E613A69102&fileName=/typescript-5.8.0-insiders.20250129.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/[email protected]".;

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
Status: Not started
Development

Successfully merging this pull request may close these issues.

Satisfies operator affects type inference for Symbol
4 participants