File: restParameterTypeInstantiation.symbols

package info (click to toggle)
node-typescript 4.9.5%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 533,908 kB
  • sloc: javascript: 2,018,330; makefile: 7; sh: 1
file content (35 lines) | stat: -rw-r--r-- 1,616 bytes parent folder | download | duplicates (4)
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
33
34
35
=== tests/cases/compiler/restParameterTypeInstantiation.ts ===
// Repro from #33823

interface TestGeneric<TG> {
>TestGeneric : Symbol(TestGeneric, Decl(restParameterTypeInstantiation.ts, 0, 0))
>TG : Symbol(TG, Decl(restParameterTypeInstantiation.ts, 2, 22))

  f: string
>f : Symbol(TestGeneric.f, Decl(restParameterTypeInstantiation.ts, 2, 27))

  g: TG
>g : Symbol(TestGeneric.g, Decl(restParameterTypeInstantiation.ts, 3, 11))
>TG : Symbol(TG, Decl(restParameterTypeInstantiation.ts, 2, 22))
}

const removeF = <TX>({ f, ...rest }: TestGeneric<TX>) => {
>removeF : Symbol(removeF, Decl(restParameterTypeInstantiation.ts, 7, 5))
>TX : Symbol(TX, Decl(restParameterTypeInstantiation.ts, 7, 17))
>f : Symbol(f, Decl(restParameterTypeInstantiation.ts, 7, 22))
>rest : Symbol(rest, Decl(restParameterTypeInstantiation.ts, 7, 25))
>TestGeneric : Symbol(TestGeneric, Decl(restParameterTypeInstantiation.ts, 0, 0))
>TX : Symbol(TX, Decl(restParameterTypeInstantiation.ts, 7, 17))

  return rest
>rest : Symbol(rest, Decl(restParameterTypeInstantiation.ts, 7, 25))
}

const result: number = removeF<number>({ f: '', g: 3 }).g
>result : Symbol(result, Decl(restParameterTypeInstantiation.ts, 11, 5))
>removeF<number>({ f: '', g: 3 }).g : Symbol(TestGeneric.g, Decl(restParameterTypeInstantiation.ts, 3, 11))
>removeF : Symbol(removeF, Decl(restParameterTypeInstantiation.ts, 7, 5))
>f : Symbol(f, Decl(restParameterTypeInstantiation.ts, 11, 40))
>g : Symbol(g, Decl(restParameterTypeInstantiation.ts, 11, 47))
>g : Symbol(TestGeneric.g, Decl(restParameterTypeInstantiation.ts, 3, 11))