Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

TIL that TypeScript can detect 'break' clauses in while (true) loops. Pretty freaking cool.

54,548 görüntüleme • 1 yıl önce •via X (Twitter)

10 Yorum

Erik profil fotoğrafı
Erik1 yıl önce

Wow they solved the halting problem

Sahaj Jain profil fotoğrafı
Sahaj Jain1 yıl önce

TIL that TypeScript also supports break with labelNames

ᴛᴏʟʟʏ ( ͡° ͜ʖ ͡°) profil fotoğrafı
ᴛᴏʟʟʏ ( ͡° ͜ʖ ͡°)1 yıl önce

what if you change 0.5 to 1?

0xAlice (e/tard) profil fotoğrafı
0xAlice (e/tard)1 yıl önce

😭😭😭

Matt Pocock profil fotoğrafı
Matt Pocock1 yıl önce

?

Tiger Abrodi profil fotoğrafı
Tiger Abrodi1 yıl önce

I kind of expected this though What would be interesting is if it can narrow down e.g. based on a value, so in a while loop, if we I don't know, hit the value 5, then we return Otherwise we continue If it knows that That'd be even more badass

Samual Norman 🦋 @samual.uk profil fotoğrafı
Samual Norman 🦋 @samual.uk1 yıl önce

TypeScript's control flow analysis is the best I've seen in any language

Prasenjit profil fotoğrafı
Prasenjit1 yıl önce

That's a pretty cool trick for sure, thanks for sharing about it. it's going to help a lot.

Jaid profil fotoğrafı
Jaid1 yıl önce

How much effort does it put into determining whether the break statement itself is reachable?

0xAlice (e/tard) profil fotoğrafı
0xAlice (e/tard)1 yıl önce

this is like, the whole idea behind the never type. man oh man ...

Benzer Videolar