-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Closed
Copy link
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
Description
π Search Terms
type predicate mapped
π Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about type system behavior
β― Playground Link
π» Code
abstract class Arbitrary<T> {
abstract canShrinkWithoutContext(value: unknown): value is T;
abstract xyzzy<Us extends unknown[]>(
x: { [K in keyof Us]: Us[K] },
): Arbitrary<Us>;
}
abstract class MyArbitrary<T> extends Arbitrary<T> {
abstract xyzzy<Us extends unknown[]>(
x: { [K in keyof Us]: Us[K] },
): Arbitrary<Us>;
}
π Actual behavior
The compiler reports an error in MyArbitrary
unless canShrinkWithoutContext
is removed or its return type is changed.
π Expected behavior
The xyzzy
method should be overridden in the derived class.
Additional information about the issue
No response
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue