-
Notifications
You must be signed in to change notification settings - Fork 12.8k
spread operator infer to wrong type with method override and generic #59281
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
The error here is because you're trying to spread a |
That's right. I changed the title. |
And if this is an unintended bug, I would love to contribute. Where can I find the changes to the 5.3.0-dev.20231027 distribution version? |
|
I'll try it within a week. Thanks for sharing. |
Given that overloads are generally picked from the top to the bottom. Shouldn't this be fixed at the definition site of this Similarly, it works OK if you combine those 2 overloads into a single signature: TS playground. This solution should be preferred over the first one. |
I agree with @Andarist 's comments in the PR - this doesn't seem like a bug. |
This issue has been marked as "Not a Defect" and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
π Search Terms
generic spread
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play/?ts=5.5.3&ssl=9&ssc=72&pln=10&pc=79#code/C4TwDgpgBAsg9gYwNYDECGDhwE4gOoCWwAFgBIQA2k2APDFALxQCuAdkq3AO6sB8jUABQBYAFBQoBALZgcwAPLYCAcwKs0FAFw0AKlAgAPYBFYATAM6wBMXoICUjfgAVscKQXMRdvMQ4bO0bGACDRoAJQgEHFMaJAgQOAAzWAAaKDRWEF4fUVBIKBc3Dwh4ZHRMHHwiMkpqOgE2Dm4+ARFxSRk5RRU1DU0oXX0jEwsrJht7RwLXd09vXynC2a8nQODQiKjsGLiE5Jg0jKzssTEo1nNgFmCtKABvMQkpRCRvQWfTZgoIfqXi7zSiQwWFwAH5+qVUMDKoQSOQqBBaDpeHZ+gA3OAEUyPKDPZBvD5fH7TIpzZGA6Fg34zYqQ8ogqpw2qI7yoqAYrFiAC+Age7TxSH6gkm-nuXIcaEsR25AG5TqJBJKQKwEFBEmxMAQ4KxJnyJMwbgA6AWCaSyIKCADkYDQJEtdkO5mVqtNnSC3VU6gofn4gj1EighqDiq4aCIHXNCiUno09jsOPFdjlonF9hlQA
π» Code
π Actual behavior
Typescirpt throw error like
Spread types may only be created from object types.(2698);
on line spread syntaxπ Expected behavior
Typescirpt should not throw error on inline spread syntax.
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: