File: subtypingWithObjectMembersOptionality4.symbols

package info (click to toggle)
node-typescript 2.1.5-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 203,952 kB
  • ctags: 52,987
  • sloc: sh: 11; makefile: 5
file content (75 lines) | stat: -rw-r--r-- 3,067 bytes parent folder | download | duplicates (2)
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
=== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersOptionality4.ts ===
// Base has required property, derived adds an optional property, no errors

interface Base { foo: string; }
>Base : Symbol(Base, Decl(subtypingWithObjectMembersOptionality4.ts, 0, 0))
>foo : Symbol(Base.foo, Decl(subtypingWithObjectMembersOptionality4.ts, 2, 16))

interface Derived extends Base { bar: string; }
>Derived : Symbol(Derived, Decl(subtypingWithObjectMembersOptionality4.ts, 2, 31))
>Base : Symbol(Base, Decl(subtypingWithObjectMembersOptionality4.ts, 0, 0))
>bar : Symbol(Derived.bar, Decl(subtypingWithObjectMembersOptionality4.ts, 3, 32))

interface T {
>T : Symbol(T, Decl(subtypingWithObjectMembersOptionality4.ts, 3, 47))

    Foo: Base;
>Foo : Symbol(T.Foo, Decl(subtypingWithObjectMembersOptionality4.ts, 5, 13))
>Base : Symbol(Base, Decl(subtypingWithObjectMembersOptionality4.ts, 0, 0))
}

interface S extends T {
>S : Symbol(S, Decl(subtypingWithObjectMembersOptionality4.ts, 7, 1))
>T : Symbol(T, Decl(subtypingWithObjectMembersOptionality4.ts, 3, 47))

    Foo2?: Derived // ok
>Foo2 : Symbol(S.Foo2, Decl(subtypingWithObjectMembersOptionality4.ts, 9, 23))
>Derived : Symbol(Derived, Decl(subtypingWithObjectMembersOptionality4.ts, 2, 31))
}

interface T2 {
>T2 : Symbol(T2, Decl(subtypingWithObjectMembersOptionality4.ts, 11, 1))

    1: Base; 
>Base : Symbol(Base, Decl(subtypingWithObjectMembersOptionality4.ts, 0, 0))
}

interface S2 extends T2 {
>S2 : Symbol(S2, Decl(subtypingWithObjectMembersOptionality4.ts, 15, 1))
>T2 : Symbol(T2, Decl(subtypingWithObjectMembersOptionality4.ts, 11, 1))

    2?: Derived; // ok
>Derived : Symbol(Derived, Decl(subtypingWithObjectMembersOptionality4.ts, 2, 31))
}

interface T3 {
>T3 : Symbol(T3, Decl(subtypingWithObjectMembersOptionality4.ts, 19, 1))

    '1': Base;
>Base : Symbol(Base, Decl(subtypingWithObjectMembersOptionality4.ts, 0, 0))
}

interface S3 extends T3 {
>S3 : Symbol(S3, Decl(subtypingWithObjectMembersOptionality4.ts, 23, 1))
>T3 : Symbol(T3, Decl(subtypingWithObjectMembersOptionality4.ts, 19, 1))

    '1.0'?: Derived; // ok
>Derived : Symbol(Derived, Decl(subtypingWithObjectMembersOptionality4.ts, 2, 31))
}

// object literal case
var a: { Foo: Base; }
>a : Symbol(a, Decl(subtypingWithObjectMembersOptionality4.ts, 30, 3))
>Foo : Symbol(Foo, Decl(subtypingWithObjectMembersOptionality4.ts, 30, 8))
>Base : Symbol(Base, Decl(subtypingWithObjectMembersOptionality4.ts, 0, 0))

var b: { Foo2?: Derived; }
>b : Symbol(b, Decl(subtypingWithObjectMembersOptionality4.ts, 31, 3))
>Foo2 : Symbol(Foo2, Decl(subtypingWithObjectMembersOptionality4.ts, 31, 8))
>Derived : Symbol(Derived, Decl(subtypingWithObjectMembersOptionality4.ts, 2, 31))

var r = true ? a : b; // ok
>r : Symbol(r, Decl(subtypingWithObjectMembersOptionality4.ts, 32, 3))
>a : Symbol(a, Decl(subtypingWithObjectMembersOptionality4.ts, 30, 3))
>b : Symbol(b, Decl(subtypingWithObjectMembersOptionality4.ts, 31, 3))