TypeScript/tests/baselines/reference/destructuringParameterProperties4.errors.txt

60 lines
3.3 KiB
Plaintext
Raw Normal View History

tests/cases/conformance/es6/destructuring/destructuringParameterProperties4.ts(3,31): error TS1187: A parameter property may not be a binding pattern.
2015-01-14 23:20:32 +01:00
tests/cases/conformance/es6/destructuring/destructuringParameterProperties4.ts(4,59): error TS2339: Property 'b' does not exist on type 'C1<T, U, V>'.
tests/cases/conformance/es6/destructuring/destructuringParameterProperties4.ts(4,83): error TS2339: Property 'c' does not exist on type 'C1<T, U, V>'.
tests/cases/conformance/es6/destructuring/destructuringParameterProperties4.ts(5,18): error TS2339: Property 'a' does not exist on type 'C1<T, U, V>'.
tests/cases/conformance/es6/destructuring/destructuringParameterProperties4.ts(10,21): error TS2339: Property 'a' does not exist on type 'C1<T, U, V>'.
tests/cases/conformance/es6/destructuring/destructuringParameterProperties4.ts(14,21): error TS2339: Property 'b' does not exist on type 'C1<T, U, V>'.
tests/cases/conformance/es6/destructuring/destructuringParameterProperties4.ts(18,21): error TS2339: Property 'c' does not exist on type 'C1<T, U, V>'.
tests/cases/conformance/es6/destructuring/destructuringParameterProperties4.ts(24,24): error TS2339: Property 'a' does not exist on type 'C2'.
tests/cases/conformance/es6/destructuring/destructuringParameterProperties4.ts(24,34): error TS2339: Property 'b' does not exist on type 'C2'.
tests/cases/conformance/es6/destructuring/destructuringParameterProperties4.ts(24,44): error TS2339: Property 'c' does not exist on type 'C2'.
2015-01-14 01:06:34 +01:00
==== tests/cases/conformance/es6/destructuring/destructuringParameterProperties4.ts (10 errors) ====
2015-01-14 01:06:34 +01:00
class C1<T, U, V> {
constructor(private k: T, protected [a, b, c]: [T,U,V]) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS1187: A parameter property may not be a binding pattern.
2015-01-14 01:06:34 +01:00
if ((b === undefined && c === undefined) || (this.b === undefined && this.c === undefined)) {
~
!!! error TS2339: Property 'b' does not exist on type 'C1<T, U, V>'.
~
!!! error TS2339: Property 'c' does not exist on type 'C1<T, U, V>'.
this.a = a || k;
~
!!! error TS2339: Property 'a' does not exist on type 'C1<T, U, V>'.
}
}
public getA() {
return this.a
~
!!! error TS2339: Property 'a' does not exist on type 'C1<T, U, V>'.
}
public getB() {
return this.b
~
!!! error TS2339: Property 'b' does not exist on type 'C1<T, U, V>'.
}
public getC() {
return this.c;
~
!!! error TS2339: Property 'c' does not exist on type 'C1<T, U, V>'.
}
}
class C2 extends C1<number, string, boolean> {
public doSomethingWithSuperProperties() {
2015-01-14 02:45:02 +01:00
return `${this.a} ${this.b} ${this.c}`;
2015-01-14 01:06:34 +01:00
~
2015-01-14 02:45:02 +01:00
!!! error TS2339: Property 'a' does not exist on type 'C2'.
2015-01-14 01:06:34 +01:00
~
2015-01-14 02:45:02 +01:00
!!! error TS2339: Property 'b' does not exist on type 'C2'.
2015-01-14 01:06:34 +01:00
~
2015-01-14 02:45:02 +01:00
!!! error TS2339: Property 'c' does not exist on type 'C2'.
2015-01-14 01:06:34 +01:00
}
}