66fa9f6cd7
* Use a limited version of getApparentType that doesnt map primitives * Reuse [most of] getBaseConstraintOfType, since it does the needed behaviors * Move new function next to the very similar function
9 lines
264 B
TypeScript
9 lines
264 B
TypeScript
// @strict: true
|
|
declare function foo(p: string): void;
|
|
|
|
function fn<T extends string | undefined, U extends string>(one: T, two: U) {
|
|
let three = Boolean() ? one : two;
|
|
foo(one!);
|
|
foo(two!);
|
|
foo(three!); // this line is the important one
|
|
} |