|
| 1 | +//// [tests/cases/compiler/genericCallInferenceConditionalType1.ts] //// |
| 2 | + |
| 3 | +=== genericCallInferenceConditionalType1.ts === |
| 4 | +// https://github.com/microsoft/TypeScript/issues/59108 |
| 5 | + |
| 6 | +declare const f: <T>(f: (x: T) => unknown) => (x: T) => unknown; |
| 7 | +>f : Symbol(f, Decl(genericCallInferenceConditionalType1.ts, 2, 13)) |
| 8 | +>T : Symbol(T, Decl(genericCallInferenceConditionalType1.ts, 2, 18)) |
| 9 | +>f : Symbol(f, Decl(genericCallInferenceConditionalType1.ts, 2, 21)) |
| 10 | +>x : Symbol(x, Decl(genericCallInferenceConditionalType1.ts, 2, 25)) |
| 11 | +>T : Symbol(T, Decl(genericCallInferenceConditionalType1.ts, 2, 18)) |
| 12 | +>x : Symbol(x, Decl(genericCallInferenceConditionalType1.ts, 2, 47)) |
| 13 | +>T : Symbol(T, Decl(genericCallInferenceConditionalType1.ts, 2, 18)) |
| 14 | + |
| 15 | +declare const g: <T extends unknown>(x: { foo: T }) => unknown; |
| 16 | +>g : Symbol(g, Decl(genericCallInferenceConditionalType1.ts, 3, 13)) |
| 17 | +>T : Symbol(T, Decl(genericCallInferenceConditionalType1.ts, 3, 18)) |
| 18 | +>x : Symbol(x, Decl(genericCallInferenceConditionalType1.ts, 3, 37)) |
| 19 | +>foo : Symbol(foo, Decl(genericCallInferenceConditionalType1.ts, 3, 41)) |
| 20 | +>T : Symbol(T, Decl(genericCallInferenceConditionalType1.ts, 3, 18)) |
| 21 | + |
| 22 | +const h = f(g); |
| 23 | +>h : Symbol(h, Decl(genericCallInferenceConditionalType1.ts, 5, 5)) |
| 24 | +>f : Symbol(f, Decl(genericCallInferenceConditionalType1.ts, 2, 13)) |
| 25 | +>g : Symbol(g, Decl(genericCallInferenceConditionalType1.ts, 3, 13)) |
| 26 | + |
| 27 | +type FirstParameter<T> = T extends (x: infer P) => unknown ? P : unknown; |
| 28 | +>FirstParameter : Symbol(FirstParameter, Decl(genericCallInferenceConditionalType1.ts, 5, 15)) |
| 29 | +>T : Symbol(T, Decl(genericCallInferenceConditionalType1.ts, 7, 20)) |
| 30 | +>T : Symbol(T, Decl(genericCallInferenceConditionalType1.ts, 7, 20)) |
| 31 | +>x : Symbol(x, Decl(genericCallInferenceConditionalType1.ts, 7, 36)) |
| 32 | +>P : Symbol(P, Decl(genericCallInferenceConditionalType1.ts, 7, 44)) |
| 33 | +>P : Symbol(P, Decl(genericCallInferenceConditionalType1.ts, 7, 44)) |
| 34 | + |
| 35 | +type X = FirstParameter<typeof h>["foo"]; |
| 36 | +>X : Symbol(X, Decl(genericCallInferenceConditionalType1.ts, 7, 73)) |
| 37 | +>FirstParameter : Symbol(FirstParameter, Decl(genericCallInferenceConditionalType1.ts, 5, 15)) |
| 38 | +>h : Symbol(h, Decl(genericCallInferenceConditionalType1.ts, 5, 5)) |
| 39 | + |
0 commit comments