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
|
=== tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration5.ts ===
// Parameter Declaration with generic
interface F { }
>F : Symbol(F, Decl(destructuringParameterDeclaration5.ts, 0, 0))
class Class implements F {
>Class : Symbol(Class, Decl(destructuringParameterDeclaration5.ts, 2, 15))
>F : Symbol(F, Decl(destructuringParameterDeclaration5.ts, 0, 0))
constructor() { }
}
class SubClass extends Class {
>SubClass : Symbol(SubClass, Decl(destructuringParameterDeclaration5.ts, 5, 1))
>Class : Symbol(Class, Decl(destructuringParameterDeclaration5.ts, 2, 15))
foo: boolean;
>foo : Symbol(SubClass.foo, Decl(destructuringParameterDeclaration5.ts, 7, 30))
constructor() { super(); }
>super : Symbol(Class, Decl(destructuringParameterDeclaration5.ts, 2, 15))
}
class D implements F {
>D : Symbol(D, Decl(destructuringParameterDeclaration5.ts, 10, 1))
>F : Symbol(F, Decl(destructuringParameterDeclaration5.ts, 0, 0))
foo: boolean
>foo : Symbol(D.foo, Decl(destructuringParameterDeclaration5.ts, 12, 22))
constructor() { }
}
class SubD extends D {
>SubD : Symbol(SubD, Decl(destructuringParameterDeclaration5.ts, 15, 1))
>D : Symbol(D, Decl(destructuringParameterDeclaration5.ts, 10, 1))
bar: number
>bar : Symbol(SubD.bar, Decl(destructuringParameterDeclaration5.ts, 17, 22))
constructor() {
super();
>super : Symbol(D, Decl(destructuringParameterDeclaration5.ts, 10, 1))
}
}
function d0<T extends Class>({x} = { x: new Class() }) { }
>d0 : Symbol(d0, Decl(destructuringParameterDeclaration5.ts, 22, 1))
>T : Symbol(T, Decl(destructuringParameterDeclaration5.ts, 25, 12))
>Class : Symbol(Class, Decl(destructuringParameterDeclaration5.ts, 2, 15))
>x : Symbol(x, Decl(destructuringParameterDeclaration5.ts, 25, 30))
>x : Symbol(x, Decl(destructuringParameterDeclaration5.ts, 25, 36))
>Class : Symbol(Class, Decl(destructuringParameterDeclaration5.ts, 2, 15))
function d1<T extends F>({x}: { x: F }) { }
>d1 : Symbol(d1, Decl(destructuringParameterDeclaration5.ts, 25, 58))
>T : Symbol(T, Decl(destructuringParameterDeclaration5.ts, 26, 12))
>F : Symbol(F, Decl(destructuringParameterDeclaration5.ts, 0, 0))
>x : Symbol(x, Decl(destructuringParameterDeclaration5.ts, 26, 26))
>x : Symbol(x, Decl(destructuringParameterDeclaration5.ts, 26, 31))
>F : Symbol(F, Decl(destructuringParameterDeclaration5.ts, 0, 0))
function d2<T extends Class>({x}: { x: Class }) { }
>d2 : Symbol(d2, Decl(destructuringParameterDeclaration5.ts, 26, 43))
>T : Symbol(T, Decl(destructuringParameterDeclaration5.ts, 27, 12))
>Class : Symbol(Class, Decl(destructuringParameterDeclaration5.ts, 2, 15))
>x : Symbol(x, Decl(destructuringParameterDeclaration5.ts, 27, 30))
>x : Symbol(x, Decl(destructuringParameterDeclaration5.ts, 27, 35))
>Class : Symbol(Class, Decl(destructuringParameterDeclaration5.ts, 2, 15))
function d3<T extends D>({y}: { y: D }) { }
>d3 : Symbol(d3, Decl(destructuringParameterDeclaration5.ts, 27, 51))
>T : Symbol(T, Decl(destructuringParameterDeclaration5.ts, 28, 12))
>D : Symbol(D, Decl(destructuringParameterDeclaration5.ts, 10, 1))
>y : Symbol(y, Decl(destructuringParameterDeclaration5.ts, 28, 26))
>y : Symbol(y, Decl(destructuringParameterDeclaration5.ts, 28, 31))
>D : Symbol(D, Decl(destructuringParameterDeclaration5.ts, 10, 1))
function d4<T extends D>({y} = { y: new D() }) { }
>d4 : Symbol(d4, Decl(destructuringParameterDeclaration5.ts, 28, 43))
>T : Symbol(T, Decl(destructuringParameterDeclaration5.ts, 29, 12))
>D : Symbol(D, Decl(destructuringParameterDeclaration5.ts, 10, 1))
>y : Symbol(y, Decl(destructuringParameterDeclaration5.ts, 29, 26))
>y : Symbol(y, Decl(destructuringParameterDeclaration5.ts, 29, 32))
>D : Symbol(D, Decl(destructuringParameterDeclaration5.ts, 10, 1))
var obj = new Class();
>obj : Symbol(obj, Decl(destructuringParameterDeclaration5.ts, 31, 3))
>Class : Symbol(Class, Decl(destructuringParameterDeclaration5.ts, 2, 15))
d0({ x: 1 });
>d0 : Symbol(d0, Decl(destructuringParameterDeclaration5.ts, 22, 1))
>x : Symbol(x, Decl(destructuringParameterDeclaration5.ts, 32, 4))
d0({ x: {} });
>d0 : Symbol(d0, Decl(destructuringParameterDeclaration5.ts, 22, 1))
>x : Symbol(x, Decl(destructuringParameterDeclaration5.ts, 33, 4))
d0({ x: "string" });
>d0 : Symbol(d0, Decl(destructuringParameterDeclaration5.ts, 22, 1))
>x : Symbol(x, Decl(destructuringParameterDeclaration5.ts, 34, 4))
d1({ x: new Class() });
>d1 : Symbol(d1, Decl(destructuringParameterDeclaration5.ts, 25, 58))
>x : Symbol(x, Decl(destructuringParameterDeclaration5.ts, 36, 4))
>Class : Symbol(Class, Decl(destructuringParameterDeclaration5.ts, 2, 15))
d1({ x: {} });
>d1 : Symbol(d1, Decl(destructuringParameterDeclaration5.ts, 25, 58))
>x : Symbol(x, Decl(destructuringParameterDeclaration5.ts, 37, 4))
d1({ x: "string" });
>d1 : Symbol(d1, Decl(destructuringParameterDeclaration5.ts, 25, 58))
>x : Symbol(x, Decl(destructuringParameterDeclaration5.ts, 38, 4))
d2({ x: new SubClass() });
>d2 : Symbol(d2, Decl(destructuringParameterDeclaration5.ts, 26, 43))
>x : Symbol(x, Decl(destructuringParameterDeclaration5.ts, 40, 4))
>SubClass : Symbol(SubClass, Decl(destructuringParameterDeclaration5.ts, 5, 1))
d2({ x: {} });
>d2 : Symbol(d2, Decl(destructuringParameterDeclaration5.ts, 26, 43))
>x : Symbol(x, Decl(destructuringParameterDeclaration5.ts, 41, 4))
d3({ y: new SubD() });
>d3 : Symbol(d3, Decl(destructuringParameterDeclaration5.ts, 27, 51))
>y : Symbol(y, Decl(destructuringParameterDeclaration5.ts, 43, 4))
>SubD : Symbol(SubD, Decl(destructuringParameterDeclaration5.ts, 15, 1))
d3({ y: new SubClass() });
>d3 : Symbol(d3, Decl(destructuringParameterDeclaration5.ts, 27, 51))
>y : Symbol(y, Decl(destructuringParameterDeclaration5.ts, 44, 4))
>SubClass : Symbol(SubClass, Decl(destructuringParameterDeclaration5.ts, 5, 1))
// Error
d3({ y: new Class() });
>d3 : Symbol(d3, Decl(destructuringParameterDeclaration5.ts, 27, 51))
>y : Symbol(y, Decl(destructuringParameterDeclaration5.ts, 46, 4))
>Class : Symbol(Class, Decl(destructuringParameterDeclaration5.ts, 2, 15))
d3({});
>d3 : Symbol(d3, Decl(destructuringParameterDeclaration5.ts, 27, 51))
d3({ y: 1 });
>d3 : Symbol(d3, Decl(destructuringParameterDeclaration5.ts, 27, 51))
>y : Symbol(y, Decl(destructuringParameterDeclaration5.ts, 48, 4))
d3({ y: "world" });
>d3 : Symbol(d3, Decl(destructuringParameterDeclaration5.ts, 27, 51))
>y : Symbol(y, Decl(destructuringParameterDeclaration5.ts, 49, 4))
|