Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
xg15
on April 4, 2022
|
parent
|
context
|
favorite
| on:
Why don't more languages offer flow typing?
Yes, that's correct. In the GP example, c was const, so the type can be determined at compile time.
simulate-me
on April 4, 2022
[–]
I was writing TypeScript, where const just means the variable is not reassigned. For instance this is valid:
const c: C = Math.random() < 0.5 ? { type: 'a' } : { type: 'b' }.
xg15
on April 5, 2022
|
parent
[–]
Ah, I'm sorry. You're right of course!
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: