News for hackers. Stuff that matters.
Re:TypeScript 3.7 Beta by mcaruso on Wednesday October 02, 2019 @09:45AM (#21136333)
`const` variables are actually inferred without widening. So in your example `dir` would be inferred as `"up"`, not `string`. If you use `let` (or `var`) however that would be true.
Re:TypeScript 3.7 Beta by azangru on Wednesday October 02, 2019 @10:07AM (#21136578)
My god, you are right!

(example in typescript playground: https://www.typescriptlang.org/play/#code/C4TwDgpgBAIglgJwgY...)

Re:TypeScript 3.7 Beta by skrebbel on Wednesday October 02, 2019 @11:46AM (#21137721)
Oh wow! Great, thanks. I wonder how I recalled that wrong.