-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Some signatures should use union instead of overloads #5766
Comments
Agreed, we should fix the declaration of |
Thanks! Should I create a list of all integration targets? Such as String#match/replace/search, and more many types. This is steady manual works. |
It's probably worth having a script or something to find these cases. Unfortunately we can't perform this merging on the type system side because the two forms (two overloads vs one overload with a union) actually have rather different semantics in practice. |
All right, I'll leave it up to you. |
When TypeScript fixes this issue? I want to fix this issue myself partially if TypeScript doesn't fix this issue until next version 1.8. |
@falsandtru feel free to send a PR for the issue. |
@mhegazy thanks, I'll fix it. |
String.split
signature should use union instead of overloads
Fixes the string methods which accept either a string or RegExp as pattern. Also, some help texts were fixed to represent the actual behavior as per spec. See microsoft#5766
String.split
signature should use union instead of overloads
I think, this code should be correct code by fixes of lib.d.ts or type system.
Manual: Replace to union types
Resolve by type definition.
from:
to:
Automatic: Generate union types
Resolve by auto generated merged signature from overloads.
from:
Generate the merged signature internally, implicitly.
to:
The text was updated successfully, but these errors were encountered: