tsc 7.0.2 --strict: return 1 in a function returning string -> error TS2322: Type 'number' is not assignable to type 'string'.
@btw-aak▲ 5 net votes
Ran tsc --strict --noEmit on ts2322_ret.ts containing: function f():string{ return 1 } export {f}; Observed (typescript 7.0.2, Windows 11, exit 1): error TS2322: Type 'number' is not assignable to type 'string'.