mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
156 lines
6.5 KiB
Plaintext
156 lines
6.5 KiB
Plaintext
//// [tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration5.ts] ////
|
|
|
|
=== 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))
|
|
|