-
-
It's that throws() produces a rejected promise, which isn't turned into an error until someone awaits it.
2 replies 0 retweets 7 likes -
I think this only makes sense to me b/c I have students build a sync/await with a generator function. Easier to spot the yield vs return. 1/
1 reply 0 retweets 0 likes -
Replying to @michaellnorth @wycats and
Once you hide all that ugly stuff, it’s easy to get lost again. 2/2
1 reply 0 retweets 0 likes -
Replying to @michaellnorth @BenLesh and
I'm not claiming it's not a gotcha, but rather that it's intrinsic to the tradeoff that lets us have "sequential but not sync" w/o types
1 reply 0 retweets 0 likes -
Replying to @wycats @michaellnorth and
but I think good linters (and type systems like TS) could help catch these kinds of bugs and should.
1 reply 0 retweets 2 likes -
Replying to @wycats @michaellnorth and
One of the things I appreciate about
@reasonml is the ability to insist a function deals with promises "correctly".2 replies 0 retweets 2 likes -
Replying to @bassjacob @michaellnorth and
fwiw rust has a similar facility (via must_use types and a high fidelity lint) that I think TSLint should integrate.
1 reply 0 retweets 0 likes -
Replying to @wycats @michaellnorth and
that sounds really cool, though compiler > linter imo. keep meaning to find time to learn rust. wasm might be the final straw. or rocket.rs
1 reply 0 retweets 0 likes -
Replying to @bassjacob @michaellnorth and
Rust lints passes are often part of the compiler. The difference is that there's a way to disable lints.
2 replies 0 retweets 0 likes
Here's a thread on the topic: https://internals.rust-lang.org/t/why-is-ignoring-a-must-use-trigger-a-warning-rather-than-an-error/3380/3 … TLDR the philosophy is to be extremely sensitive to false positives in lints.
-
-
Replying to @wycats @bassjacob and
But people can (and do) use #![deny(all)] to turn lints into errors (or something more granular than all like unused_must_use)
0 replies 0 retweets 0 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.