Y
Hacker News
new
|
ask
|
show
|
jobs
by
seanwilson
2418 days ago
Thanks, you can still trick it with this though (there's no type error):
const x = [1, 2] as const; const r = 666 + 1; const y = x[r]; const z = y + 3;
1 comments
nine_k
2418 days ago
Let's wait until TS supports dependent types!
link