Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

as const + satisfies works incorrect #611

Open
Komock opened this issue Aug 18, 2024 · 0 comments
Open

as const + satisfies works incorrect #611

Komock opened this issue Aug 18, 2024 · 0 comments

Comments

@Komock
Copy link

Komock commented Aug 18, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant