mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
29 lines
1.5 KiB
Plaintext
29 lines
1.5 KiB
Plaintext
destructureComputedProperty.ts(5,19): error TS2564: Property 'p' has no initializer and is not definitely assigned in the constructor.
|
|
destructureComputedProperty.ts(7,9): error TS2341: Property 'p' is private and only accessible within class 'C'.
|
|
destructureComputedProperty.ts(8,9): error TS2341: Property 'p' is private and only accessible within class 'C'.
|
|
destructureComputedProperty.ts(9,9): error TS2341: Property 'p' is private and only accessible within class 'C'.
|
|
destructureComputedProperty.ts(10,9): error TS2341: Property 'p' is private and only accessible within class 'C'.
|
|
|
|
|
|
==== destructureComputedProperty.ts (5 errors) ====
|
|
declare const ab: { n: number } | { n: string };
|
|
const nameN = "n";
|
|
const { [nameN]: n } = ab;
|
|
|
|
class C { private p: number; }
|
|
~
|
|
!!! error TS2564: Property 'p' has no initializer and is not definitely assigned in the constructor.
|
|
const nameP = "p";
|
|
const { "p": p0 } = new C();
|
|
~~~
|
|
!!! error TS2341: Property 'p' is private and only accessible within class 'C'.
|
|
const { ["p"]: p1 } = new C();
|
|
~~~~~
|
|
!!! error TS2341: Property 'p' is private and only accessible within class 'C'.
|
|
const { [nameP]: p2 } = new C();
|
|
~~~~~~~
|
|
!!! error TS2341: Property 'p' is private and only accessible within class 'C'.
|
|
const { p: p3 } = new C();
|
|
~
|
|
!!! error TS2341: Property 'p' is private and only accessible within class 'C'.
|
|
|