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 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
|
=== tests/cases/conformance/types/intersection/intersectionThisTypes.ts ===
interface Thing1 {
>Thing1 : Symbol(Thing1, Decl(intersectionThisTypes.ts, 0, 0))
a: number;
>a : Symbol(Thing1.a, Decl(intersectionThisTypes.ts, 0, 18))
self(): this;
>self : Symbol(Thing1.self, Decl(intersectionThisTypes.ts, 1, 14))
}
interface Thing2 {
>Thing2 : Symbol(Thing2, Decl(intersectionThisTypes.ts, 3, 1))
b: number;
>b : Symbol(Thing2.b, Decl(intersectionThisTypes.ts, 5, 18))
me(): this;
>me : Symbol(Thing2.me, Decl(intersectionThisTypes.ts, 6, 14))
}
type Thing3 = Thing1 & Thing2;
>Thing3 : Symbol(Thing3, Decl(intersectionThisTypes.ts, 8, 1))
>Thing1 : Symbol(Thing1, Decl(intersectionThisTypes.ts, 0, 0))
>Thing2 : Symbol(Thing2, Decl(intersectionThisTypes.ts, 3, 1))
type Thing4 = Thing3 & string[];
>Thing4 : Symbol(Thing4, Decl(intersectionThisTypes.ts, 10, 30))
>Thing3 : Symbol(Thing3, Decl(intersectionThisTypes.ts, 8, 1))
function f1(t: Thing3) {
>f1 : Symbol(f1, Decl(intersectionThisTypes.ts, 11, 32))
>t : Symbol(t, Decl(intersectionThisTypes.ts, 13, 12))
>Thing3 : Symbol(Thing3, Decl(intersectionThisTypes.ts, 8, 1))
t = t.self();
>t : Symbol(t, Decl(intersectionThisTypes.ts, 13, 12))
>t.self : Symbol(Thing1.self, Decl(intersectionThisTypes.ts, 1, 14))
>t : Symbol(t, Decl(intersectionThisTypes.ts, 13, 12))
>self : Symbol(Thing1.self, Decl(intersectionThisTypes.ts, 1, 14))
t = t.me().self().me();
>t : Symbol(t, Decl(intersectionThisTypes.ts, 13, 12))
>t.me().self().me : Symbol(Thing2.me, Decl(intersectionThisTypes.ts, 6, 14))
>t.me().self : Symbol(Thing1.self, Decl(intersectionThisTypes.ts, 1, 14))
>t.me : Symbol(Thing2.me, Decl(intersectionThisTypes.ts, 6, 14))
>t : Symbol(t, Decl(intersectionThisTypes.ts, 13, 12))
>me : Symbol(Thing2.me, Decl(intersectionThisTypes.ts, 6, 14))
>self : Symbol(Thing1.self, Decl(intersectionThisTypes.ts, 1, 14))
>me : Symbol(Thing2.me, Decl(intersectionThisTypes.ts, 6, 14))
}
interface Thing5 extends Thing4 {
>Thing5 : Symbol(Thing5, Decl(intersectionThisTypes.ts, 16, 1))
>Thing4 : Symbol(Thing4, Decl(intersectionThisTypes.ts, 10, 30))
c: string;
>c : Symbol(Thing5.c, Decl(intersectionThisTypes.ts, 18, 33))
}
function f2(t: Thing5) {
>f2 : Symbol(f2, Decl(intersectionThisTypes.ts, 20, 1))
>t : Symbol(t, Decl(intersectionThisTypes.ts, 22, 12))
>Thing5 : Symbol(Thing5, Decl(intersectionThisTypes.ts, 16, 1))
t = t.self();
>t : Symbol(t, Decl(intersectionThisTypes.ts, 22, 12))
>t.self : Symbol(Thing1.self, Decl(intersectionThisTypes.ts, 1, 14))
>t : Symbol(t, Decl(intersectionThisTypes.ts, 22, 12))
>self : Symbol(Thing1.self, Decl(intersectionThisTypes.ts, 1, 14))
t = t.me().self().me();
>t : Symbol(t, Decl(intersectionThisTypes.ts, 22, 12))
>t.me().self().me : Symbol(Thing2.me, Decl(intersectionThisTypes.ts, 6, 14))
>t.me().self : Symbol(Thing1.self, Decl(intersectionThisTypes.ts, 1, 14))
>t.me : Symbol(Thing2.me, Decl(intersectionThisTypes.ts, 6, 14))
>t : Symbol(t, Decl(intersectionThisTypes.ts, 22, 12))
>me : Symbol(Thing2.me, Decl(intersectionThisTypes.ts, 6, 14))
>self : Symbol(Thing1.self, Decl(intersectionThisTypes.ts, 1, 14))
>me : Symbol(Thing2.me, Decl(intersectionThisTypes.ts, 6, 14))
}
interface Component {
>Component : Symbol(Component, Decl(intersectionThisTypes.ts, 25, 1))
extend<T>(props: T): this & T;
>extend : Symbol(Component.extend, Decl(intersectionThisTypes.ts, 27, 21))
>T : Symbol(T, Decl(intersectionThisTypes.ts, 28, 11))
>props : Symbol(props, Decl(intersectionThisTypes.ts, 28, 14))
>T : Symbol(T, Decl(intersectionThisTypes.ts, 28, 11))
>T : Symbol(T, Decl(intersectionThisTypes.ts, 28, 11))
}
interface Label extends Component {
>Label : Symbol(Label, Decl(intersectionThisTypes.ts, 29, 1))
>Component : Symbol(Component, Decl(intersectionThisTypes.ts, 25, 1))
title: string;
>title : Symbol(Label.title, Decl(intersectionThisTypes.ts, 31, 35))
}
function test(label: Label) {
>test : Symbol(test, Decl(intersectionThisTypes.ts, 33, 1))
>label : Symbol(label, Decl(intersectionThisTypes.ts, 35, 14))
>Label : Symbol(Label, Decl(intersectionThisTypes.ts, 29, 1))
const extended = label.extend({ id: 67 }).extend({ tag: "hello" });
>extended : Symbol(extended, Decl(intersectionThisTypes.ts, 36, 9))
>label.extend({ id: 67 }).extend : Symbol(Component.extend, Decl(intersectionThisTypes.ts, 27, 21))
>label.extend : Symbol(Component.extend, Decl(intersectionThisTypes.ts, 27, 21))
>label : Symbol(label, Decl(intersectionThisTypes.ts, 35, 14))
>extend : Symbol(Component.extend, Decl(intersectionThisTypes.ts, 27, 21))
>id : Symbol(id, Decl(intersectionThisTypes.ts, 36, 35))
>extend : Symbol(Component.extend, Decl(intersectionThisTypes.ts, 27, 21))
>tag : Symbol(tag, Decl(intersectionThisTypes.ts, 36, 54))
extended.id; // Ok
>extended.id : Symbol(id, Decl(intersectionThisTypes.ts, 36, 35))
>extended : Symbol(extended, Decl(intersectionThisTypes.ts, 36, 9))
>id : Symbol(id, Decl(intersectionThisTypes.ts, 36, 35))
extended.tag; // Ok
>extended.tag : Symbol(tag, Decl(intersectionThisTypes.ts, 36, 54))
>extended : Symbol(extended, Decl(intersectionThisTypes.ts, 36, 9))
>tag : Symbol(tag, Decl(intersectionThisTypes.ts, 36, 54))
}
|