Ask HN: TypeScript experts, is this a type checking issue?
3 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:
Post Comments (Atom)
Honduras Issues Arrest Warrant for Ex-President Pardoned by Trump
By Annie Correal from NYT World https://ift.tt/YahRsjO via IFTTT
-
Mux (YC W16) is hiring across the board to build the future of online video 1 by mmcclure | 0 comments on Hacker News.
-
By Patricia Mazzei from NYT U.S. https://ift.tt/SunLVyf via IFTTT
-
By Annie Correal from NYT World https://ift.tt/YahRsjO via IFTTT
No comments:
Post a Comment