File: inferTypesWithExtends2.symbols

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (32 lines) | stat: -rw-r--r-- 1,509 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
=== tests/cases/conformance/types/conditional/inferTypesWithExtends2.ts ===
// infer twice with different constraints (same behavior as class/interface)
type X1<T> =
>X1 : Symbol(X1, Decl(inferTypesWithExtends2.ts, 0, 0))
>T : Symbol(T, Decl(inferTypesWithExtends2.ts, 1, 8))

    T extends { a: infer U extends string, b: infer U extends number } ? U :
>T : Symbol(T, Decl(inferTypesWithExtends2.ts, 1, 8))
>a : Symbol(a, Decl(inferTypesWithExtends2.ts, 2, 15))
>U : Symbol(U, Decl(inferTypesWithExtends2.ts, 2, 24), Decl(inferTypesWithExtends2.ts, 2, 51))
>b : Symbol(b, Decl(inferTypesWithExtends2.ts, 2, 42))
>U : Symbol(U, Decl(inferTypesWithExtends2.ts, 2, 24), Decl(inferTypesWithExtends2.ts, 2, 51))
>U : Symbol(U, Decl(inferTypesWithExtends2.ts, 2, 24), Decl(inferTypesWithExtends2.ts, 2, 51))

    never;

// infer cannot reference type params in same 'extends' clause
type X2<T> =
>X2 : Symbol(X2, Decl(inferTypesWithExtends2.ts, 3, 10))
>T : Symbol(T, Decl(inferTypesWithExtends2.ts, 6, 8))

    T extends { a: infer U, b: infer V extends U } ? [U, V] :
>T : Symbol(T, Decl(inferTypesWithExtends2.ts, 6, 8))
>a : Symbol(a, Decl(inferTypesWithExtends2.ts, 7, 15))
>U : Symbol(U, Decl(inferTypesWithExtends2.ts, 7, 24))
>b : Symbol(b, Decl(inferTypesWithExtends2.ts, 7, 27))
>V : Symbol(V, Decl(inferTypesWithExtends2.ts, 7, 36))
>U : Symbol(U)
>U : Symbol(U, Decl(inferTypesWithExtends2.ts, 7, 24))
>V : Symbol(V, Decl(inferTypesWithExtends2.ts, 7, 36))

    never;