-
-
Notifications
You must be signed in to change notification settings - Fork 222
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
Typescript does not report an error with the sample
#888
Comments
Functions with generics are tough to generalize in typescript, so it’s very hard for us to make this working properly, but we’ll try |
zerobias
added
bug
Something isn't working
typings
Typescript public type definitions issues
labels
Apr 15, 2023
sergeysova
changed the title
Typescript does not report an error with the
Typescript does not report an error with the Apr 15, 2023
sample
([link](https://tsplay.dev/w2zJ4w))sample
An example how it's done with RxJS https://github.com/ReactiveX/rxjs/blob/master/src/internal/operators/filter.ts#L7 export function filter<T, S extends T, A>(predicate: (this: A, value: T, index: number) => value is S, thisArg: A): OperatorFunction<T, S>;
export function filter<T, S extends T>(predicate: (value: T, index: number) => value is S): OperatorFunction<T, S>;
export function filter<T>(predicate: BooleanConstructor): OperatorFunction<T, TruthyTypesOf<T>>;
/** @deprecated Use a closure instead of a `thisArg`. Signatures accepting a `thisArg` will be removed in v8. */
export function filter<T, A>(predicate: (this: A, value: T, index: number) => boolean, thisArg: A): MonoTypeOperatorFunction<T>;
export function filter<T>(predicate: (value: T, index: number) => boolean): MonoTypeOperatorFunction<T>;
export function filter<T>(predicate: (value: T, index: number) => boolean, thisArg?: any): MonoTypeOperatorFunction<T> { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
One more case when typescript does not report an error with the
sample
(link)Originally posted by @Lonli-Lokli in #811 (comment)
The text was updated successfully, but these errors were encountered: