The code provided above is prone to failure. TypeScript may mistakenly infer the return type as `string`, allowing you to use the `charAt` method on it even though the actual type is `number`.
Is there a solution to enhance the code in a way that TypeScript can catch this bug?
function fn(s: number): number
function fn(n: string): string
function fn(arg: any): any { return 0 }
fn("hi").charAt(0)