Загрузка видео...

Не удалось загрузить видео

На главную

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

54,548 просмотров • 1 год назад •via X (Twitter)

Комментарии: 10

Фото профиля Erik
Erik1 год назад

Wow they solved the halting problem

Фото профиля Sahaj Jain
Sahaj Jain1 год назад

TIL that TypeScript also supports break with labelNames

Фото профиля ᴛᴏʟʟʏ ( ͡° ͜ʖ ͡°)
ᴛᴏʟʟʏ ( ͡° ͜ʖ ͡°)1 год назад

what if you change 0.5 to 1?

Фото профиля 0xAlice (e/tard)
0xAlice (e/tard)1 год назад

😭😭😭

Фото профиля Matt Pocock
Matt Pocock1 год назад

?

Фото профиля Tiger Abrodi
Tiger Abrodi1 год назад

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
Samual Norman 🦋 @samual.uk1 год назад

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

Фото профиля Prasenjit
Prasenjit1 год назад

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

Фото профиля Jaid
Jaid1 год назад

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

Фото профиля 0xAlice (e/tard)
0xAlice (e/tard)1 год назад

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

Похожие видео