Describe the bug
ReadonlyArrays aren't Passable because they don't conform to CopyArrayInterface. CopyArrays are hardened, thus the mutating methods will always fail, and marking them as readonly only changes the typing to omit the mutating methods.
Steps to reproduce
- Create
repro.ts with the following contents:
import type { Passable } from '@endo/pass-style';
export default ['ibc'] as Readonly<[string]> satisfies Passable;
- Load in IDE or compile with
tsc, and see error:
Type 'readonly [string]' does not satisfy the expected type 'Passable'.
Type 'readonly [string]' is not assignable to type 'CopyArrayInterface<PassableCap, Error>'.ts(1360)
Expected behavior
No error.
Platform environment
- What OS are you using? macOS
- What version of Node.js? v22.21.0
- Is there anything special/unusual about your platform? not especially
- What version of Endo are you using? @endo/import-bundle@1.5.2-303-g31f81e8ac`
Describe the bug
ReadonlyArrays aren't Passable because they don't conform to CopyArrayInterface. CopyArrays are hardened, thus the mutating methods will always fail, and marking them as
readonlyonly changes the typing to omit the mutating methods.Steps to reproduce
repro.tswith the following contents:tsc, and see error:Expected behavior
No error.
Platform environment