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

Item 41: Understand Evolving any #8

Open
danvk opened this issue Mar 1, 2022 · 3 comments
Open

Item 41: Understand Evolving any #8

danvk opened this issue Mar 1, 2022 · 3 comments
Labels
💬 blog comments Comments on effectivetypescript.com (Utterances)

Comments

@danvk
Copy link
Owner

danvk commented Mar 1, 2022

Item 41: Understand Evolving any

https://effectivetypescript.com/2020/03/09/evolving-any/

@danvk danvk added the 💬 blog comments Comments on effectivetypescript.com (Utterances) label Mar 1, 2022
@danvk
Copy link
Owner Author

danvk commented Mar 1, 2022

Comment by disqus_0l6QhEp9JS on 2020-11-28 03:11:

"A final case that triggers this "evolving any" behavior is if a variable is initially null. This often comes up when you set a value in a try/catch block:" This seems out of place - it's in the middle of a different case - and it's obviously missing at least an example piece of code, if not more...

"This behavior can be confusing to follow in your editor since the type is only "evolved" after you assign or push an element. Inspecting the type on the line with the assignment will still show any or any[]." Shouldn't this paragraph be somewhere else as well?

Asking because I'm interested in the missing example :)

@danvk
Copy link
Owner Author

danvk commented Mar 1, 2022

Comment by danvdk on 2020-11-28 10:02:

Gah, should be fixed now, thanks for the heads up. (This broke along with a few other things as a result of incorporating literate-ts into the blog.)

@danvk
Copy link
Owner Author

danvk commented Mar 1, 2022

Comment by disqus_0l6QhEp9JS on 2020-11-29 07:02:

No problem! Looking forward to reading the book now :)

jasonlotz pushed a commit to jasonlotz/effective-typescript-sandbox that referenced this issue Nov 12, 2023
jasonlotz added a commit to jasonlotz/effective-typescript-sandbox that referenced this issue Nov 15, 2023
jasonlotz added a commit to jasonlotz/effective-typescript-sandbox that referenced this issue Nov 15, 2023
jasonlotz added a commit to jasonlotz/effective-typescript-sandbox that referenced this issue Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💬 blog comments Comments on effectivetypescript.com (Utterances)
Projects
None yet
Development

No branches or pull requests

1 participant