71 lines
4.1 KiB
Plaintext
71 lines
4.1 KiB
Plaintext
tests/cases/conformance/es6/destructuring/destructuringParameterProperties1.ts(2,17): error TS1187: A parameter property may not be a binding pattern.
|
|
tests/cases/conformance/es6/destructuring/destructuringParameterProperties1.ts(9,17): error TS1187: A parameter property may not be a binding pattern.
|
|
tests/cases/conformance/es6/destructuring/destructuringParameterProperties1.ts(16,17): error TS1187: A parameter property may not be a binding pattern.
|
|
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'.
|
|
|
|
|
|
==== tests/cases/conformance/es6/destructuring/destructuringParameterProperties1.ts (13 errors) ====
|
|
class C1 {
|
|
constructor(public [x, y, z]: string[]) {
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS1187: A parameter property may not be a binding pattern.
|
|
}
|
|
}
|
|
|
|
type TupleType1 = [string, number, boolean];
|
|
|
|
class C2 {
|
|
constructor(public [x, y, z]: TupleType1) {
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS1187: A parameter property may not be a binding pattern.
|
|
}
|
|
}
|
|
|
|
type ObjType1 = { x: number; y: string; z: boolean }
|
|
|
|
class C3 {
|
|
constructor(public { x, y, z }: ObjType1) {
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS1187: A parameter property may not be a binding pattern.
|
|
}
|
|
}
|
|
|
|
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]);
|
|
var [c2_x, c2_y, c2_z] = [c2.x, c2.y, c2.z];
|
|
~
|
|
!!! error TS2339: Property 'x' does not exist on type 'C2'.
|
|
~
|
|
!!! error TS2339: Property 'y' does not exist on type 'C2'.
|
|
~
|
|
!!! error TS2339: Property 'z' does not exist on type 'C2'.
|
|
|
|
var c3 = new C3({x: 0, y: "", z: false});
|
|
c3 = new C3({x: 0, "y": "y", z: true});
|
|
var [c3_x, c3_y, c3_z] = [c3.x, c3.y, c3.z];
|
|
~
|
|
!!! error TS2339: Property 'x' does not exist on type 'C3'.
|
|
~
|
|
!!! error TS2339: Property 'y' does not exist on type 'C3'.
|
|
~
|
|
!!! error TS2339: Property 'z' does not exist on type 'C3'. |