File: objectTypeWithRecursiveWrappedProperty.symbols

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 (38 lines) | stat: -rw-r--r-- 1,760 bytes parent folder | download | duplicates (5)
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
=== tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedProperty.ts ===
// Basic recursive type

class List<T> {
>List : Symbol(List, Decl(objectTypeWithRecursiveWrappedProperty.ts, 0, 0))
>T : Symbol(T, Decl(objectTypeWithRecursiveWrappedProperty.ts, 2, 11))

    data: T;
>data : Symbol(List.data, Decl(objectTypeWithRecursiveWrappedProperty.ts, 2, 15))
>T : Symbol(T, Decl(objectTypeWithRecursiveWrappedProperty.ts, 2, 11))

    next: List<List<T>>;
>next : Symbol(List.next, Decl(objectTypeWithRecursiveWrappedProperty.ts, 3, 12))
>List : Symbol(List, Decl(objectTypeWithRecursiveWrappedProperty.ts, 0, 0))
>List : Symbol(List, Decl(objectTypeWithRecursiveWrappedProperty.ts, 0, 0))
>T : Symbol(T, Decl(objectTypeWithRecursiveWrappedProperty.ts, 2, 11))
}

var list1 = new List<number>();
>list1 : Symbol(list1, Decl(objectTypeWithRecursiveWrappedProperty.ts, 7, 3))
>List : Symbol(List, Decl(objectTypeWithRecursiveWrappedProperty.ts, 0, 0))

var list2 = new List<number>();
>list2 : Symbol(list2, Decl(objectTypeWithRecursiveWrappedProperty.ts, 8, 3))
>List : Symbol(List, Decl(objectTypeWithRecursiveWrappedProperty.ts, 0, 0))

var list3 = new List<string>();
>list3 : Symbol(list3, Decl(objectTypeWithRecursiveWrappedProperty.ts, 9, 3))
>List : Symbol(List, Decl(objectTypeWithRecursiveWrappedProperty.ts, 0, 0))

list1 = list2; // ok
>list1 : Symbol(list1, Decl(objectTypeWithRecursiveWrappedProperty.ts, 7, 3))
>list2 : Symbol(list2, Decl(objectTypeWithRecursiveWrappedProperty.ts, 8, 3))

list1 = list3; // error
>list1 : Symbol(list1, Decl(objectTypeWithRecursiveWrappedProperty.ts, 7, 3))
>list3 : Symbol(list3, Decl(objectTypeWithRecursiveWrappedProperty.ts, 9, 3))