News for hackers. Stuff that matters.
Re:From Rust to TypeScript by Stratoscope on Saturday September 12, 2020 @02:53PM (#24454540)
Plus the undefined name 'number' in foo(). TypeScript flags that along with 'baz();'.

What does puzzle me is that TS doesn't flag 'return bar(someNumber) + bar;' - I'm curious if anyone knows why it seems to allow that.

Re:From Rust to TypeScript by josh64 on Saturday September 12, 2020 @05:51PM (#24456167)
I think because the return type hasn't been specified for the function, so it is inferring the return type from the return statement (which means it is "correct").

Don't forget JavaScript (and therefore typescript) will let you concatenate a lot of random types together without error.