🔎 Search Terms
NonNullable undefined
🕗 Version & Regression Information
- This changed between versions 5.3 and 5.4.0-dev.20231202
⏯ Playground Link
https://www.typescriptlang.org/play?strict=false&strictPropertyInitialization=false&strictBindCallApply=false&noImplicitReturns=false&ts=5.4.0-dev.20231202#code/KYDwDg9gTgLgBASwHY2FAZgQwMbDgYQgFsiIkB1KTMMNAHgAU4BeOAbwF8A+dgKDkRIAbhADWwOvwHSBAaTihUSACYBnOADkyGgK4AbPZgBGeiVJkW+l69IDa85HHEBPCOjgMAugC4P9zwogSmpwABShAHRRmFAA5r6YSM62ngCULDwiCMrpAD5wOirA6MjAynAA-HDyvkjAQmgA3OY2cBy2Lm4eni0yXAA0LVyhvdLIIuIMUBBgGphEwL6ygzKpvgz+zRy8vMioGDh4APJgMAhkmHoAYoXYZ2RTM1bS6Lf3SI9gFaFrcFnKWx2ymA2EMUDw2DIqngAHcqDQ0L5CCQyJRqLQoHQTu9LjckHdzh9pmAuDs4ei0BFxmJgKEAESvfHvT501K8ckIqBU4Q00KFYElOo5IA
💻 Code
exportinterfaceCommonWrapper<P={}>{invoke<KextendsNonNullable<{[KinkeyofP]: P[K]extends((...arg: any[])=>void)|undefined ? K : never;}[keyofP]>,>(invokePropName: K,): P[K];}interfaceOptionalFunctionProp{functionProp?(): void;}declareconstwrapper: 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
🔎 Search Terms
NonNullable undefined
🕗 Version & Regression Information
⏯ Playground Link
https://www.typescriptlang.org/play?strict=false&strictPropertyInitialization=false&strictBindCallApply=false&noImplicitReturns=false&ts=5.4.0-dev.20231202#code/KYDwDg9gTgLgBASwHY2FAZgQwMbDgYQgFsiIkB1KTMMNAHgAU4BeOAbwF8A+dgKDkRIAbhADWwOvwHSBAaTihUSACYBnOADkyGgK4AbPZgBGeiVJkW+l69IDa85HHEBPCOjgMAugC4P9zwogSmpwABShAHRRmFAA5r6YSM62ngCULDwiCMrpAD5wOirA6MjAynAA-HDyvkjAQmgA3OY2cBy2Lm4eni0yXAA0LVyhvdLIIuIMUBBgGphEwL6ygzKpvgz+zRy8vMioGDh4APJgMAhkmHoAYoXYZ2RTM1bS6Lf3SI9gFaFrcFnKWx2ymA2EMUDw2DIqngAHcqDQ0L5CCQyJRqLQoHQTu9LjckHdzh9pmAuDs4ei0BFxmJgKEAESvfHvT501K8ckIqBU4Q00KFYElOo5IA
💻 Code
🙁 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/enzymetests: https://github.com/DefinitelyTyped/DefinitelyTyped/actions/runs/7057196205/job/19245682552?pr=67570