mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
59 lines
2.9 KiB
Plaintext
59 lines
2.9 KiB
Plaintext
destructuringParameterProperties4.ts(2,31): error TS1187: A parameter property may not be declared using a binding pattern.
|
|
destructuringParameterProperties4.ts(3,59): error TS2339: Property 'b' does not exist on type 'C1<T, U, V>'.
|
|
destructuringParameterProperties4.ts(3,83): error TS2339: Property 'c' does not exist on type 'C1<T, U, V>'.
|
|
destructuringParameterProperties4.ts(4,18): error TS2339: Property 'a' does not exist on type 'C1<T, U, V>'.
|
|
destructuringParameterProperties4.ts(9,21): error TS2339: Property 'a' does not exist on type 'C1<T, U, V>'.
|
|
destructuringParameterProperties4.ts(13,21): error TS2339: Property 'b' does not exist on type 'C1<T, U, V>'.
|
|
destructuringParameterProperties4.ts(17,21): error TS2339: Property 'c' does not exist on type 'C1<T, U, V>'.
|
|
destructuringParameterProperties4.ts(23,24): error TS2339: Property 'a' does not exist on type 'C2'.
|
|
destructuringParameterProperties4.ts(23,34): error TS2339: Property 'b' does not exist on type 'C2'.
|
|
destructuringParameterProperties4.ts(23,44): error TS2339: Property 'c' does not exist on type 'C2'.
|
|
|
|
|
|
==== destructuringParameterProperties4.ts (10 errors) ====
|
|
class C1<T, U, V> {
|
|
constructor(private k: T, protected [a, b, c]: [T,U,V]) {
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS1187: A parameter property may not be declared using a binding pattern.
|
|
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() {
|
|
return `${this.a} ${this.b} ${this.c}`;
|
|
~
|
|
!!! error TS2339: Property 'a' does not exist on type 'C2'.
|
|
~
|
|
!!! error TS2339: Property 'b' does not exist on type 'C2'.
|
|
~
|
|
!!! error TS2339: Property 'c' does not exist on type 'C2'.
|
|
}
|
|
}
|
|
|