File: directDependenceBetweenTypeAliases.types

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (88 lines) | stat: -rw-r--r-- 1,667 bytes parent folder | download
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
=== tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts ===
// It is an error for the type specified in a type alias to depend on that type alias

// A type alias directly depends on the type it aliases.
type T0 = T0
>T0 : any

type T0_1 = T0_2
>T0_1 : any

type T0_2 = T0_3
>T0_2 : any

type T0_3 = T0_1
>T0_3 : any

// A type reference directly depends on the referenced type and each of the type arguments, if any.
interface I<T> {}
type T1 = I<T1>
>T1 : any

// A union type directly depends on each of the constituent types.
type T2 = T2 | string
>T2 : any

class C<T> {}
>C : C<T>

type T2_1 = T2_1[] | number
>T2_1 : any

// An array type directly depends on its element type.
type T3 = T3[]
>T3 : any

// A tuple type directly depends on each of its element types.
type T4 = [number, T4]
>T4 : any

// A type query directly depends on the type of the referenced entity.
var x: T5[] = []
>x : any
>[] : undefined[]

type T5 = typeof x
>T5 : any
>x : any

class C1<T> {}
>C1 : C1<T>

type T6 = T7 | number
>T6 : any

type T7 = typeof yy
>T7 : any
>yy : any

var yy: [string, T8[]];
>yy : any

type T8 = C<T6>
>T8 : any

// legal cases
type T9 = () => T9
>T9 : T9

type T10 = { x: T10 } | { new(v: T10): string }
>T10 : T10
>x : T10
>v : T10

type T11 = T12[]
>T11 : [{ x: [any, string][]; }, string][]

type T12 = [T13, string]
>T12 : [{ x: [any, string][]; }, string]

type T13 = typeof zz
>T13 : { x: [any, string][]; }
>zz : { x: [any, string][]; }

var zz: { x: T11 }
>zz : { x: [any, string][]; }
>x : [{ x: [any, string][]; }, string][]