mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
223 lines
14 KiB
Plaintext
223 lines
14 KiB
Plaintext
destructuringUnspreadableIntoRest.ts(22,15): error TS2339: Property 'publicProp' does not exist on type 'Omit<this, "getter" | "method" | "publicProp" | "setter">'.
|
|
destructuringUnspreadableIntoRest.ts(23,15): error TS2339: Property 'publicProp' does not exist on type '{}'.
|
|
destructuringUnspreadableIntoRest.ts(25,15): error TS2339: Property 'privateProp' does not exist on type 'Omit<this, "getter" | "method" | "setter">'.
|
|
destructuringUnspreadableIntoRest.ts(26,15): error TS2339: Property 'privateProp' does not exist on type '{ publicProp: string; }'.
|
|
destructuringUnspreadableIntoRest.ts(27,15): error TS2339: Property 'privateProp' does not exist on type 'Omit<this, "getter" | "method" | "publicProp" | "setter">'.
|
|
destructuringUnspreadableIntoRest.ts(28,15): error TS2339: Property 'privateProp' does not exist on type '{}'.
|
|
destructuringUnspreadableIntoRest.ts(30,15): error TS2339: Property 'protectedProp' does not exist on type 'Omit<this, "getter" | "method" | "setter">'.
|
|
destructuringUnspreadableIntoRest.ts(31,15): error TS2339: Property 'protectedProp' does not exist on type '{ publicProp: string; }'.
|
|
destructuringUnspreadableIntoRest.ts(32,15): error TS2339: Property 'protectedProp' does not exist on type 'Omit<this, "getter" | "method" | "publicProp" | "setter">'.
|
|
destructuringUnspreadableIntoRest.ts(33,15): error TS2339: Property 'protectedProp' does not exist on type '{}'.
|
|
destructuringUnspreadableIntoRest.ts(35,15): error TS2339: Property 'getter' does not exist on type 'Omit<this, "getter" | "method" | "setter">'.
|
|
destructuringUnspreadableIntoRest.ts(36,15): error TS2339: Property 'getter' does not exist on type '{ publicProp: string; }'.
|
|
destructuringUnspreadableIntoRest.ts(37,15): error TS2339: Property 'getter' does not exist on type 'Omit<this, "getter" | "method" | "publicProp" | "setter">'.
|
|
destructuringUnspreadableIntoRest.ts(38,15): error TS2339: Property 'getter' does not exist on type '{}'.
|
|
destructuringUnspreadableIntoRest.ts(40,15): error TS2339: Property 'setter' does not exist on type 'Omit<this, "getter" | "method" | "setter">'.
|
|
destructuringUnspreadableIntoRest.ts(41,15): error TS2339: Property 'setter' does not exist on type '{ publicProp: string; }'.
|
|
destructuringUnspreadableIntoRest.ts(42,15): error TS2339: Property 'setter' does not exist on type 'Omit<this, "getter" | "method" | "publicProp" | "setter">'.
|
|
destructuringUnspreadableIntoRest.ts(43,15): error TS2339: Property 'setter' does not exist on type '{}'.
|
|
destructuringUnspreadableIntoRest.ts(45,15): error TS2339: Property 'method' does not exist on type 'Omit<this, "getter" | "method" | "setter">'.
|
|
destructuringUnspreadableIntoRest.ts(46,15): error TS2339: Property 'method' does not exist on type '{ publicProp: string; }'.
|
|
destructuringUnspreadableIntoRest.ts(47,15): error TS2339: Property 'method' does not exist on type 'Omit<this, "getter" | "method" | "publicProp" | "setter">'.
|
|
destructuringUnspreadableIntoRest.ts(48,15): error TS2339: Property 'method' does not exist on type '{}'.
|
|
destructuringUnspreadableIntoRest.ts(60,11): error TS2339: Property 'publicProp' does not exist on type 'Omit<T, "getter" | "method" | "publicProp" | "setter">'.
|
|
destructuringUnspreadableIntoRest.ts(61,11): error TS2339: Property 'publicProp' does not exist on type '{}'.
|
|
destructuringUnspreadableIntoRest.ts(63,11): error TS2339: Property 'privateProp' does not exist on type 'Omit<T, "getter" | "method" | "setter">'.
|
|
destructuringUnspreadableIntoRest.ts(64,11): error TS2339: Property 'privateProp' does not exist on type '{ publicProp: string; }'.
|
|
destructuringUnspreadableIntoRest.ts(65,11): error TS2339: Property 'privateProp' does not exist on type 'Omit<T, "getter" | "method" | "publicProp" | "setter">'.
|
|
destructuringUnspreadableIntoRest.ts(66,11): error TS2339: Property 'privateProp' does not exist on type '{}'.
|
|
destructuringUnspreadableIntoRest.ts(68,11): error TS2339: Property 'protectedProp' does not exist on type 'Omit<T, "getter" | "method" | "setter">'.
|
|
destructuringUnspreadableIntoRest.ts(69,11): error TS2339: Property 'protectedProp' does not exist on type '{ publicProp: string; }'.
|
|
destructuringUnspreadableIntoRest.ts(70,11): error TS2339: Property 'protectedProp' does not exist on type 'Omit<T, "getter" | "method" | "publicProp" | "setter">'.
|
|
destructuringUnspreadableIntoRest.ts(71,11): error TS2339: Property 'protectedProp' does not exist on type '{}'.
|
|
destructuringUnspreadableIntoRest.ts(73,11): error TS2339: Property 'getter' does not exist on type 'Omit<T, "getter" | "method" | "setter">'.
|
|
destructuringUnspreadableIntoRest.ts(74,11): error TS2339: Property 'getter' does not exist on type '{ publicProp: string; }'.
|
|
destructuringUnspreadableIntoRest.ts(75,11): error TS2339: Property 'getter' does not exist on type 'Omit<T, "getter" | "method" | "publicProp" | "setter">'.
|
|
destructuringUnspreadableIntoRest.ts(76,11): error TS2339: Property 'getter' does not exist on type '{}'.
|
|
destructuringUnspreadableIntoRest.ts(78,11): error TS2339: Property 'setter' does not exist on type 'Omit<T, "getter" | "method" | "setter">'.
|
|
destructuringUnspreadableIntoRest.ts(79,11): error TS2339: Property 'setter' does not exist on type '{ publicProp: string; }'.
|
|
destructuringUnspreadableIntoRest.ts(80,11): error TS2339: Property 'setter' does not exist on type 'Omit<T, "getter" | "method" | "publicProp" | "setter">'.
|
|
destructuringUnspreadableIntoRest.ts(81,11): error TS2339: Property 'setter' does not exist on type '{}'.
|
|
destructuringUnspreadableIntoRest.ts(83,11): error TS2339: Property 'method' does not exist on type 'Omit<T, "getter" | "method" | "setter">'.
|
|
destructuringUnspreadableIntoRest.ts(84,11): error TS2339: Property 'method' does not exist on type '{ publicProp: string; }'.
|
|
destructuringUnspreadableIntoRest.ts(85,11): error TS2339: Property 'method' does not exist on type 'Omit<T, "getter" | "method" | "publicProp" | "setter">'.
|
|
destructuringUnspreadableIntoRest.ts(86,11): error TS2339: Property 'method' does not exist on type '{}'.
|
|
|
|
|
|
==== destructuringUnspreadableIntoRest.ts (44 errors) ====
|
|
class A {
|
|
constructor(
|
|
public publicProp: string,
|
|
private privateProp: string,
|
|
protected protectedProp: string,
|
|
) {}
|
|
|
|
get getter(): number {
|
|
return 1;
|
|
}
|
|
|
|
set setter(_v: number) {}
|
|
|
|
method() {
|
|
const { ...rest1 } = this;
|
|
const { ...rest2 } = this as A;
|
|
const { publicProp: _1, ...rest3 } = this;
|
|
const { publicProp: _2, ...rest4 } = this as A;
|
|
|
|
rest1.publicProp;
|
|
rest2.publicProp;
|
|
rest3.publicProp;
|
|
~~~~~~~~~~
|
|
!!! error TS2339: Property 'publicProp' does not exist on type 'Omit<this, "getter" | "method" | "publicProp" | "setter">'.
|
|
rest4.publicProp;
|
|
~~~~~~~~~~
|
|
!!! error TS2339: Property 'publicProp' does not exist on type '{}'.
|
|
|
|
rest1.privateProp;
|
|
~~~~~~~~~~~
|
|
!!! error TS2339: Property 'privateProp' does not exist on type 'Omit<this, "getter" | "method" | "setter">'.
|
|
rest2.privateProp;
|
|
~~~~~~~~~~~
|
|
!!! error TS2339: Property 'privateProp' does not exist on type '{ publicProp: string; }'.
|
|
rest3.privateProp;
|
|
~~~~~~~~~~~
|
|
!!! error TS2339: Property 'privateProp' does not exist on type 'Omit<this, "getter" | "method" | "publicProp" | "setter">'.
|
|
rest4.privateProp;
|
|
~~~~~~~~~~~
|
|
!!! error TS2339: Property 'privateProp' does not exist on type '{}'.
|
|
|
|
rest1.protectedProp;
|
|
~~~~~~~~~~~~~
|
|
!!! error TS2339: Property 'protectedProp' does not exist on type 'Omit<this, "getter" | "method" | "setter">'.
|
|
rest2.protectedProp;
|
|
~~~~~~~~~~~~~
|
|
!!! error TS2339: Property 'protectedProp' does not exist on type '{ publicProp: string; }'.
|
|
rest3.protectedProp;
|
|
~~~~~~~~~~~~~
|
|
!!! error TS2339: Property 'protectedProp' does not exist on type 'Omit<this, "getter" | "method" | "publicProp" | "setter">'.
|
|
rest4.protectedProp;
|
|
~~~~~~~~~~~~~
|
|
!!! error TS2339: Property 'protectedProp' does not exist on type '{}'.
|
|
|
|
rest1.getter;
|
|
~~~~~~
|
|
!!! error TS2339: Property 'getter' does not exist on type 'Omit<this, "getter" | "method" | "setter">'.
|
|
rest2.getter;
|
|
~~~~~~
|
|
!!! error TS2339: Property 'getter' does not exist on type '{ publicProp: string; }'.
|
|
rest3.getter;
|
|
~~~~~~
|
|
!!! error TS2339: Property 'getter' does not exist on type 'Omit<this, "getter" | "method" | "publicProp" | "setter">'.
|
|
rest4.getter;
|
|
~~~~~~
|
|
!!! error TS2339: Property 'getter' does not exist on type '{}'.
|
|
|
|
rest1.setter;
|
|
~~~~~~
|
|
!!! error TS2339: Property 'setter' does not exist on type 'Omit<this, "getter" | "method" | "setter">'.
|
|
rest2.setter;
|
|
~~~~~~
|
|
!!! error TS2339: Property 'setter' does not exist on type '{ publicProp: string; }'.
|
|
rest3.setter;
|
|
~~~~~~
|
|
!!! error TS2339: Property 'setter' does not exist on type 'Omit<this, "getter" | "method" | "publicProp" | "setter">'.
|
|
rest4.setter;
|
|
~~~~~~
|
|
!!! error TS2339: Property 'setter' does not exist on type '{}'.
|
|
|
|
rest1.method;
|
|
~~~~~~
|
|
!!! error TS2339: Property 'method' does not exist on type 'Omit<this, "getter" | "method" | "setter">'.
|
|
rest2.method;
|
|
~~~~~~
|
|
!!! error TS2339: Property 'method' does not exist on type '{ publicProp: string; }'.
|
|
rest3.method;
|
|
~~~~~~
|
|
!!! error TS2339: Property 'method' does not exist on type 'Omit<this, "getter" | "method" | "publicProp" | "setter">'.
|
|
rest4.method;
|
|
~~~~~~
|
|
!!! error TS2339: Property 'method' does not exist on type '{}'.
|
|
}
|
|
}
|
|
|
|
function destructure<T extends A>(x: T) {
|
|
const { ...rest1 } = x;
|
|
const { ...rest2 } = x as A;
|
|
const { publicProp: _1, ...rest3 } = x;
|
|
const { publicProp: _2, ...rest4 } = x as A;
|
|
|
|
rest1.publicProp;
|
|
rest2.publicProp;
|
|
rest3.publicProp;
|
|
~~~~~~~~~~
|
|
!!! error TS2339: Property 'publicProp' does not exist on type 'Omit<T, "getter" | "method" | "publicProp" | "setter">'.
|
|
rest4.publicProp;
|
|
~~~~~~~~~~
|
|
!!! error TS2339: Property 'publicProp' does not exist on type '{}'.
|
|
|
|
rest1.privateProp;
|
|
~~~~~~~~~~~
|
|
!!! error TS2339: Property 'privateProp' does not exist on type 'Omit<T, "getter" | "method" | "setter">'.
|
|
rest2.privateProp;
|
|
~~~~~~~~~~~
|
|
!!! error TS2339: Property 'privateProp' does not exist on type '{ publicProp: string; }'.
|
|
rest3.privateProp;
|
|
~~~~~~~~~~~
|
|
!!! error TS2339: Property 'privateProp' does not exist on type 'Omit<T, "getter" | "method" | "publicProp" | "setter">'.
|
|
rest4.privateProp;
|
|
~~~~~~~~~~~
|
|
!!! error TS2339: Property 'privateProp' does not exist on type '{}'.
|
|
|
|
rest1.protectedProp;
|
|
~~~~~~~~~~~~~
|
|
!!! error TS2339: Property 'protectedProp' does not exist on type 'Omit<T, "getter" | "method" | "setter">'.
|
|
rest2.protectedProp;
|
|
~~~~~~~~~~~~~
|
|
!!! error TS2339: Property 'protectedProp' does not exist on type '{ publicProp: string; }'.
|
|
rest3.protectedProp;
|
|
~~~~~~~~~~~~~
|
|
!!! error TS2339: Property 'protectedProp' does not exist on type 'Omit<T, "getter" | "method" | "publicProp" | "setter">'.
|
|
rest4.protectedProp;
|
|
~~~~~~~~~~~~~
|
|
!!! error TS2339: Property 'protectedProp' does not exist on type '{}'.
|
|
|
|
rest1.getter;
|
|
~~~~~~
|
|
!!! error TS2339: Property 'getter' does not exist on type 'Omit<T, "getter" | "method" | "setter">'.
|
|
rest2.getter;
|
|
~~~~~~
|
|
!!! error TS2339: Property 'getter' does not exist on type '{ publicProp: string; }'.
|
|
rest3.getter;
|
|
~~~~~~
|
|
!!! error TS2339: Property 'getter' does not exist on type 'Omit<T, "getter" | "method" | "publicProp" | "setter">'.
|
|
rest4.getter;
|
|
~~~~~~
|
|
!!! error TS2339: Property 'getter' does not exist on type '{}'.
|
|
|
|
rest1.setter;
|
|
~~~~~~
|
|
!!! error TS2339: Property 'setter' does not exist on type 'Omit<T, "getter" | "method" | "setter">'.
|
|
rest2.setter;
|
|
~~~~~~
|
|
!!! error TS2339: Property 'setter' does not exist on type '{ publicProp: string; }'.
|
|
rest3.setter;
|
|
~~~~~~
|
|
!!! error TS2339: Property 'setter' does not exist on type 'Omit<T, "getter" | "method" | "publicProp" | "setter">'.
|
|
rest4.setter;
|
|
~~~~~~
|
|
!!! error TS2339: Property 'setter' does not exist on type '{}'.
|
|
|
|
rest1.method;
|
|
~~~~~~
|
|
!!! error TS2339: Property 'method' does not exist on type 'Omit<T, "getter" | "method" | "setter">'.
|
|
rest2.method;
|
|
~~~~~~
|
|
!!! error TS2339: Property 'method' does not exist on type '{ publicProp: string; }'.
|
|
rest3.method;
|
|
~~~~~~
|
|
!!! error TS2339: Property 'method' does not exist on type 'Omit<T, "getter" | "method" | "publicProp" | "setter">'.
|
|
rest4.method;
|
|
~~~~~~
|
|
!!! error TS2339: Property 'method' does not exist on type '{}'.
|
|
}
|
|
|