-
Notifications
You must be signed in to change notification settings - Fork 12.8k
satisfies
alters type inference of some (generically-typed?) variable assignments
#56623
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
Comments
Yes, |
I suppose the announcement reads a little off, then: perhaps when it's documented it could be clarified further?
|
I agree that should be clarified, but to be fair, technically if |
I assumed it would confirm that the value is assignable to the |
I think I would consider the strict array.includes behavior more the issue, no? a la https://github.com/total-typescript/ts-reset |
Duplicate of #55189β¦ the documentation is indeed misleading here |
π Search Terms
satisfies narrows generic assignment
π Version & Regression Information
This is the behavior in every version I tried (from 4.9.5), and I reviewed the FAQ for entries about Generics
β― Playground Link
https://www.typescriptlang.org/play?ts=5.3.2#code/C4TwDgpgBAChxQLxQEQGMCGwVQD6oBMB7AcxQG4AoNIgOwGcFJh6koBtdLFAGkNJQBdKPSwBLegDMxEVnGDtBVZvQB0Y2mgA2AVwKyAFCgBGYgE4EUASigB6W1FpEERANZA
π» Code
π Actual behavior
pets
is of typePet[]
π Expected behavior
pets
is of typestring[]
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: