//// [nonNullableReduction.ts] // Repros from #43425 type Transform1 = ((value: string) => T) | (string extends T ? undefined : never); type Transform2 = string extends T ? ((value: string) => T) | undefined : (value: string) => T; function test(f1: Transform1, f2: Transform2) { f1?.("hello"); f2?.("hello"); } function f1(x: T | (string extends T ? null | undefined : never)) { let z = x!; // NonNullable } function f2(x: T | U) { let z = x!; // NonNullable } //// [nonNullableReduction.js] "use strict"; // Repros from #43425 function test(f1, f2) { f1 === null || f1 === void 0 ? void 0 : f1("hello"); f2 === null || f2 === void 0 ? void 0 : f2("hello"); } function f1(x) { var z = x; // NonNullable } function f2(x) { var z = x; // NonNullable }