-
Notifications
You must be signed in to change notification settings - Fork 3k
Remove ArrayLike
from ObservableInput
#6011
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
Okay, this gets weirder and weirder... in TS 4.1.3: interface ArrayLike<T> {
readonly length: number;
// readonly 0: T;
readonly [n: number]: T;
}
function works(arg: ArrayLike<any>) {}
works(() => {});
function doesNotWork<T>(arg: ArrayLike<T>) { }
doesNotWork(() => {}); I'm not totally sure what to make of that... playground here |
Related TS issue: microsoft/TypeScript#18757 |
We probably shouldn't do this for now... this PR in TypeScript is of interest: microsoft/TypeScript#41660 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Related to this issue here: #4563
The problem is that this is true:
But at runtime, our check makes sure it's not a function:
This, combined with the fact that any "array-like" I know of has implemented
Symbol.iterator
now, means that this type is mostly worthless. I doubt many people are like:The text was updated successfully, but these errors were encountered: