2015-01-14 23:20:32 +01:00
|
|
|
tests/cases/conformance/es6/destructuring/destructuringParameterProperties1.ts(22,26): error TS2339: Property 'x' does not exist on type 'C1'.
|
|
|
|
tests/cases/conformance/es6/destructuring/destructuringParameterProperties1.ts(22,35): error TS2339: Property 'y' does not exist on type 'C1'.
|
|
|
|
tests/cases/conformance/es6/destructuring/destructuringParameterProperties1.ts(22,43): error TS2339: Property 'y' does not exist on type 'C1'.
|
|
|
|
tests/cases/conformance/es6/destructuring/destructuringParameterProperties1.ts(22,52): error TS2339: Property 'z' does not exist on type 'C1'.
|
|
|
|
tests/cases/conformance/es6/destructuring/destructuringParameterProperties1.ts(25,30): error TS2339: Property 'x' does not exist on type 'C2'.
|
|
|
|
tests/cases/conformance/es6/destructuring/destructuringParameterProperties1.ts(25,36): error TS2339: Property 'y' does not exist on type 'C2'.
|
|
|
|
tests/cases/conformance/es6/destructuring/destructuringParameterProperties1.ts(25,42): error TS2339: Property 'z' does not exist on type 'C2'.
|
|
|
|
tests/cases/conformance/es6/destructuring/destructuringParameterProperties1.ts(29,30): error TS2339: Property 'x' does not exist on type 'C3'.
|
|
|
|
tests/cases/conformance/es6/destructuring/destructuringParameterProperties1.ts(29,36): error TS2339: Property 'y' does not exist on type 'C3'.
|
|
|
|
tests/cases/conformance/es6/destructuring/destructuringParameterProperties1.ts(29,42): error TS2339: Property 'z' does not exist on type 'C3'.
|
2015-01-14 01:06:34 +01:00
|
|
|
|
|
|
|
|
2015-01-14 23:20:32 +01:00
|
|
|
==== tests/cases/conformance/es6/destructuring/destructuringParameterProperties1.ts (10 errors) ====
|
2015-01-14 01:06:34 +01:00
|
|
|
class C1 {
|
|
|
|
constructor(public [x, y, z]: string[]) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
type TupleType1 = [string, number, boolean];
|
|
|
|
|
|
|
|
class C2 {
|
|
|
|
constructor(public [x, y, z]: TupleType1) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
type ObjType1 = { x: number; y: string; z: boolean }
|
|
|
|
|
|
|
|
class C3 {
|
|
|
|
constructor(public { x, y, z }: ObjType1) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var c1 = new C1([]);
|
|
|
|
c1 = new C1(["larry", "{curly}", "moe"]);
|
|
|
|
var useC1Properties = c1.x === c1.y && c1.y === c1.z;
|
|
|
|
~
|
|
|
|
!!! error TS2339: Property 'x' does not exist on type 'C1'.
|
|
|
|
~
|
|
|
|
!!! error TS2339: Property 'y' does not exist on type 'C1'.
|
|
|
|
~
|
|
|
|
!!! error TS2339: Property 'y' does not exist on type 'C1'.
|
|
|
|
~
|
|
|
|
!!! error TS2339: Property 'z' does not exist on type 'C1'.
|
|
|
|
|
|
|
|
var c2 = new C2(["10", 10, !!10]);
|
2015-01-14 02:45:02 +01:00
|
|
|
var [c2_x, c2_y, c2_z] = [c2.x, c2.y, c2.z];
|
|
|
|
~
|
2015-01-14 01:06:34 +01:00
|
|
|
!!! error TS2339: Property 'x' does not exist on type 'C2'.
|
2015-01-14 02:45:02 +01:00
|
|
|
~
|
2015-01-14 01:06:34 +01:00
|
|
|
!!! error TS2339: Property 'y' does not exist on type 'C2'.
|
2015-01-14 02:45:02 +01:00
|
|
|
~
|
2015-01-14 01:06:34 +01:00
|
|
|
!!! error TS2339: Property 'z' does not exist on type 'C2'.
|
|
|
|
|
|
|
|
var c3 = new C3({x: 0, y: "", z: false});
|
2015-01-14 02:45:02 +01:00
|
|
|
c3 = new C3({x: 0, "y": "y", z: true});
|
|
|
|
var [c3_x, c3_y, c3_z] = [c3.x, c3.y, c3.z];
|
|
|
|
~
|
2015-01-14 01:24:23 +01:00
|
|
|
!!! error TS2339: Property 'x' does not exist on type 'C3'.
|
2015-01-14 02:45:02 +01:00
|
|
|
~
|
2015-01-14 01:24:23 +01:00
|
|
|
!!! error TS2339: Property 'y' does not exist on type 'C3'.
|
2015-01-14 02:45:02 +01:00
|
|
|
~
|
2015-01-14 01:24:23 +01:00
|
|
|
!!! error TS2339: Property 'z' does not exist on type 'C3'.
|