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

Incorrect solution in Chapter 7: Mutability, Deep Immutability with as const, Solution 2: Inferring Literal Values In Arrays #35

Open
absorpheus opened this issue Jun 28, 2024 · 1 comment

Comments

@absorpheus
Copy link

What

In Chapter 7: Mutability, Deep Immutability with as const, Solution 2: Inferring Literal Values In Arrays, Option 1: Annotate the Entire Array

Solution 2: Inferring Literal Values In Arrays

The solution is incorrect because we are passing a readonly array to a function that accepts a mutable array.

View in the TypeScript Playground

Suggestion

Perhaps refactor this as "Attempt 1" and explain why it does not work

@amanmavai
Copy link

today while reading chapter 7, encountered the same issue

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

2 participants