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

Let's wait until TS supports dependent types!