Open lewisdiamond opened 4 months ago
An interface
export interface Props { readonly myArray: readonly string[]; }
fails with =:
src/index.ts:3:17 - error JSII3001: Type "ReadonlyArray" cannot be used as the property type because it is private or @internal
preventing using it as
const arr = ["a","b"] as const
It should compile, ReadonlyArray<> is a TS type.
export interface Props { readonly p: readonly string[]; } export class C { private s: readonly string[]; constructor(p: Props) { this.s = p.p; } f() { return this.s; } }
Map ReadonlyArray to a plain array in languages not supporting readonly.
No response
latest
Linux
Describe the bug
An interface
fails with =:
preventing using it as
Expected Behavior
It should compile, ReadonlyArray<> is a TS type.
Current Behavior
src/index.ts:3:17 - error JSII3001: Type "ReadonlyArray" cannot be used as the property type because it is private or @internal
Reproduction Steps
Possible Solution
Map ReadonlyArray to a plain array in languages not supporting readonly.
Additional Information/Context
No response
SDK version used
latest
Environment details (OS name and version, etc.)
Linux