Skip to content

as const + satisfies works incorrect #611

Open
@Komock

Description

@Komock

Example - https://stackblitz.com/edit/stackblitz-starters-8zhuuy?file=types.ts,validate-schema.js.
Run npm run generate-schema in console.
Typescript compilation doesn't give any error but schema generation does:

Type 'readonly X[]' does not satisfy the expected type 'X[]'.
  The type 'readonly X[]' is 'readonly' and cannot be assigned to the mutable type 'X[]'.

In Typescript using satisfies removes readonly modifier but not in schema compilation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions