Mail Is Not Hard
2 by tambourine_man | 0 comments on Hacker News.
Sezuleir's blog . Written by Sezuleir ...email: sameerparazulee73@gmail.com If any thing about the blog . Please comment in the comment box .
Sunday, 1 September 2019
New top story on Hacker News: Ask HN: TypeScript experts, is this a type checking issue?
Ask HN: TypeScript experts, is this a type checking issue?
2 by chupa-chups | 0 comments on Hacker News.
The following ts code both compiles (with all checks active) and passes tslint without complaints: type sig = (p: number) => string; const x = (p: any) => p + 1; const y: sig = x; alert(typeof y(5)); Obviously the alert message will (and does) display 'number'. IntelliJ spots the problem though ('x' should probably not be assigned to 'y'). (Apologies if this is too stackoverflow-y, but I don't expect a "solution", I'm just interested in opinions)
2 by chupa-chups | 0 comments on Hacker News.
The following ts code both compiles (with all checks active) and passes tslint without complaints: type sig = (p: number) => string; const x = (p: any) => p + 1; const y: sig = x; alert(typeof y(5)); Obviously the alert message will (and does) display 'number'. IntelliJ spots the problem though ('x' should probably not be assigned to 'y'). (Apologies if this is too stackoverflow-y, but I don't expect a "solution", I'm just interested in opinions)
Subscribe to:
Posts (Atom)
New top story on Hacker News: Deepnote (YC S19) Is Hiring (SF, Europe, Prague)
Deepnote (YC S19) Is Hiring (SF, Europe, Prague) 1 by Equiet | 0 comments on Hacker News.
-
GitHub Launches Package Registry 8 by malvosenior | 0 comments on Hacker News.
-
Matchmaker Who Flirts on Dating Apps for You 12 by howard941 | 6 comments on Hacker News.