- Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
Design LimitationConstraints of the existing architecture prevent this from being fixedConstraints of the existing architecture prevent this from being fixed
Description
π Search Terms
NonNullable undefined
π Version & Regression Information
- This changed between versions 5.3 and 5.4.0-dev.20231202
β― Playground Link
π» Code
export interface CommonWrapper<P = {}> { invoke< K extends NonNullable< { [K in keyof P]: P[K] extends ((...arg: any[]) => void) | undefined ? K : never; }[keyof P] >, >( invokePropName: K, ): P[K]; } interface OptionalFunctionProp { functionProp?(): void; } declare const wrapper: CommonWrapper<OptionalFunctionProp> wrapper.invoke("functionProp") wrapper.invoke(undefined)
π Actual behavior
No error
π Expected behavior
Argument of type 'undefined' is not assignable to parameter of type '"functionProp"'.(2345)
Additional information about the issue
Breaks @types/enzyme
tests: https://github.com/DefinitelyTyped/DefinitelyTyped/actions/runs/7057196205/job/19245682552?pr=67570
Metadata
Metadata
Assignees
Labels
Design LimitationConstraints of the existing architecture prevent this from being fixedConstraints of the existing architecture prevent this from being fixed