
burnt out eng; he/him; texan transplanted in WA then CA; English/中文/🇫🇷/🇯🇵; learning ייִדיש, español, 한국어; alt @a_wil_a_way
- Tweets26.7K
- Following1.9K
- Followers1.1K
- Likes283K

North America
DiscussingFilm@DiscussingFilmSep 11United Kingdom

ALT honk@gosling tsc % bat -p demo.ts type Config = { port: number }; const cfg: Config = { port: "8080" }; honk@gosling tsc % tsc --noEmit demo.ts demo.ts:2:23 - error TS2322: Type 'string' is not assignable to type 'number'. 2 const cfg: Config = { port: "8080" }; ~~~~ demo.ts:1:17 1 type Config = { port: number }; ~~~~ The expected type comes from property 'port' which is declared here on type 'Config' Found 1 error in demo.ts:2 honk@gosling tsc % du -h out/release/tsc 25M out/release/tsc honk@gosling tsc % ./out/release/tsc --noEmit demo.ts demo.ts:2:23 - error TS2322: Type 'string' is not assignable to type 'number'. 2 const cfg: Config = { port: "8080" }; ~~~~ demo.ts:1:17 1 type Config = { port: number }; ~~~~ The expected type comes from property 'port' which is declared here on type 'Config' Found 1 error in demo.ts:2































