mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
29 lines
1.2 KiB
Plaintext
29 lines
1.2 KiB
Plaintext
destructuringAssignment_private.ts(6,10): error TS2341: Property 'x' is private and only accessible within class 'C'.
|
|
destructuringAssignment_private.ts(7,4): error TS2341: Property 'o' is private and only accessible within class 'C'.
|
|
destructuringAssignment_private.ts(10,10): error TS2341: Property 'x' is private and only accessible within class 'C'.
|
|
destructuringAssignment_private.ts(13,4): error TS2341: Property 'o' is private and only accessible within class 'C'.
|
|
|
|
|
|
==== destructuringAssignment_private.ts (4 errors) ====
|
|
class C {
|
|
private x = 0;
|
|
private o = [{ a: 1 }];
|
|
}
|
|
let x: number;
|
|
([{ a: { x } }] = [{ a: new C() }]);
|
|
~
|
|
!!! error TS2341: Property 'x' is private and only accessible within class 'C'.
|
|
({ o: [{ a: x }]} = new C());
|
|
~
|
|
!!! error TS2341: Property 'o' is private and only accessible within class 'C'.
|
|
|
|
const nameX = "x";
|
|
([{ a: { [nameX]: x } }] = [{ a: new C() }]);
|
|
~~~~~~~
|
|
!!! error TS2341: Property 'x' is private and only accessible within class 'C'.
|
|
|
|
const nameO = "o";
|
|
({ [nameO]: [{ a: x }]} = new C());
|
|
~~~~~~~
|
|
!!! error TS2341: Property 'o' is private and only accessible within class 'C'.
|
|
|