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

Component Prop TypeScript Regression #2506

Open
huntabyte opened this issue Sep 19, 2024 · 0 comments
Open

Component Prop TypeScript Regression #2506

huntabyte opened this issue Sep 19, 2024 · 0 comments
Labels
bug Something isn't working Fixed Fixed in master branch. Pending production release.

Comments

@huntabyte
Copy link
Member

Describe the bug

bind: does not respect discriminated unions and merges the possible types into one.

Likely introduced here? #2477

CleanShot 2024-09-18 at 20 24 50@2x
image

Reproduction

https://github.com/huntabyte/disc-union-repro

Expected behaviour

Respect discriminated unions.

System Info

  • OS: Max
  • IDE: VSCode

Which package is the issue about?

Svelte for VS Code extension, svelte-language-server, svelte2tsx, svelte-check

Additional Information, eg. Screenshots

No response

@huntabyte huntabyte added the bug Something isn't working label Sep 19, 2024
@dummdidumm dummdidumm added the Fixed Fixed in master branch. Pending production release. label Sep 19, 2024
dummdidumm added a commit that referenced this issue Sep 19, 2024
This reverts commit 8c080cf.

This reverts #2477. Sadly, the idea didn't work out, as shown by two opened bug reports:

- #2506: A type union can be narrowed on the input, but not on the way back out
- #2494: A generic nested within a bound value is not properly resolved and not falling back to `any` (in #2477 we thought of the generic case, but only for when the generic is the whole value type, not when it's nested)

For these reasons I don't see a way to properly implement #1392 at the moment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Fixed Fixed in master branch. Pending production release.
Projects
None yet
Development

No branches or pull requests

2 participants