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 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
|
=== tests/cases/conformance/expressions/typeGuards/typeGuardOfFormIsTypeOnInterfaces.ts ===
interface C1 {
>C1 : Symbol(C1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 0, 0))
(): C1;
>C1 : Symbol(C1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 0, 0))
prototype: C1;
>prototype : Symbol(C1.prototype, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 1, 11))
>C1 : Symbol(C1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 0, 0))
p1: string;
>p1 : Symbol(C1.p1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 2, 18))
}
interface C2 {
>C2 : Symbol(C2, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 4, 1))
(): C2;
>C2 : Symbol(C2, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 4, 1))
prototype: C2;
>prototype : Symbol(C2.prototype, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 6, 11))
>C2 : Symbol(C2, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 4, 1))
p2: number;
>p2 : Symbol(C2.p2, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 7, 18))
}
interface D1 extends C1 {
>D1 : Symbol(D1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 9, 1))
>C1 : Symbol(C1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 0, 0))
prototype: D1;
>prototype : Symbol(D1.prototype, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 10, 25))
>D1 : Symbol(D1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 9, 1))
p3: number;
>p3 : Symbol(D1.p3, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 11, 18))
}
var str: string;
>str : Symbol(str, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 14, 3))
var num: number;
>num : Symbol(num, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 15, 3))
var strOrNum: string | number;
>strOrNum : Symbol(strOrNum, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 16, 3))
function isC1(x: any): x is C1 {
>isC1 : Symbol(isC1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 16, 30))
>x : Symbol(x, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 19, 14))
>x : Symbol(x, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 19, 14))
>C1 : Symbol(C1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 0, 0))
return true;
}
function isC2(x: any): x is C2 {
>isC2 : Symbol(isC2, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 21, 1))
>x : Symbol(x, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 23, 14))
>x : Symbol(x, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 23, 14))
>C2 : Symbol(C2, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 4, 1))
return true;
}
function isD1(x: any): x is D1 {
>isD1 : Symbol(isD1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 25, 1))
>x : Symbol(x, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 27, 14))
>x : Symbol(x, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 27, 14))
>D1 : Symbol(D1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 9, 1))
return true;
}
var c1: C1;
>c1 : Symbol(c1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 31, 3))
>C1 : Symbol(C1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 0, 0))
var c2: C2;
>c2 : Symbol(c2, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 32, 3))
>C2 : Symbol(C2, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 4, 1))
var d1: D1;
>d1 : Symbol(d1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 33, 3))
>D1 : Symbol(D1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 9, 1))
var c1Orc2: C1 | C2;
>c1Orc2 : Symbol(c1Orc2, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 34, 3))
>C1 : Symbol(C1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 0, 0))
>C2 : Symbol(C2, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 4, 1))
str = isC1(c1Orc2) && c1Orc2.p1; // C1
>str : Symbol(str, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 14, 3))
>isC1 : Symbol(isC1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 16, 30))
>c1Orc2 : Symbol(c1Orc2, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 34, 3))
>c1Orc2.p1 : Symbol(C1.p1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 2, 18))
>c1Orc2 : Symbol(c1Orc2, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 34, 3))
>p1 : Symbol(C1.p1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 2, 18))
num = isC2(c1Orc2) && c1Orc2.p2; // C2
>num : Symbol(num, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 15, 3))
>isC2 : Symbol(isC2, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 21, 1))
>c1Orc2 : Symbol(c1Orc2, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 34, 3))
>c1Orc2.p2 : Symbol(C2.p2, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 7, 18))
>c1Orc2 : Symbol(c1Orc2, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 34, 3))
>p2 : Symbol(C2.p2, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 7, 18))
str = isD1(c1Orc2) && c1Orc2.p1; // D1
>str : Symbol(str, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 14, 3))
>isD1 : Symbol(isD1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 25, 1))
>c1Orc2 : Symbol(c1Orc2, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 34, 3))
>c1Orc2.p1 : Symbol(C1.p1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 2, 18))
>c1Orc2 : Symbol(c1Orc2, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 34, 3))
>p1 : Symbol(C1.p1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 2, 18))
num = isD1(c1Orc2) && c1Orc2.p3; // D1
>num : Symbol(num, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 15, 3))
>isD1 : Symbol(isD1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 25, 1))
>c1Orc2 : Symbol(c1Orc2, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 34, 3))
>c1Orc2.p3 : Symbol(D1.p3, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 11, 18))
>c1Orc2 : Symbol(c1Orc2, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 34, 3))
>p3 : Symbol(D1.p3, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 11, 18))
var c2Ord1: C2 | D1;
>c2Ord1 : Symbol(c2Ord1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 40, 3))
>C2 : Symbol(C2, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 4, 1))
>D1 : Symbol(D1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 9, 1))
num = isC2(c2Ord1) && c2Ord1.p2; // C2
>num : Symbol(num, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 15, 3))
>isC2 : Symbol(isC2, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 21, 1))
>c2Ord1 : Symbol(c2Ord1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 40, 3))
>c2Ord1.p2 : Symbol(C2.p2, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 7, 18))
>c2Ord1 : Symbol(c2Ord1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 40, 3))
>p2 : Symbol(C2.p2, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 7, 18))
num = isD1(c2Ord1) && c2Ord1.p3; // D1
>num : Symbol(num, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 15, 3))
>isD1 : Symbol(isD1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 25, 1))
>c2Ord1 : Symbol(c2Ord1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 40, 3))
>c2Ord1.p3 : Symbol(D1.p3, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 11, 18))
>c2Ord1 : Symbol(c2Ord1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 40, 3))
>p3 : Symbol(D1.p3, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 11, 18))
str = isD1(c2Ord1) && c2Ord1.p1; // D1
>str : Symbol(str, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 14, 3))
>isD1 : Symbol(isD1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 25, 1))
>c2Ord1 : Symbol(c2Ord1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 40, 3))
>c2Ord1.p1 : Symbol(C1.p1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 2, 18))
>c2Ord1 : Symbol(c2Ord1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 40, 3))
>p1 : Symbol(C1.p1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 2, 18))
var r2: C2 | D1 = isC1(c2Ord1) && c2Ord1; // C2 | D1
>r2 : Symbol(r2, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 44, 3))
>C2 : Symbol(C2, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 4, 1))
>D1 : Symbol(D1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 9, 1))
>isC1 : Symbol(isC1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 16, 30))
>c2Ord1 : Symbol(c2Ord1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 40, 3))
>c2Ord1 : Symbol(c2Ord1, Decl(typeGuardOfFormIsTypeOnInterfaces.ts, 40, 3))
|