stringLiteralTypesOverloads03.ts(30,18): error TS2454: Variable 'hello' is used before being assigned.
stringLiteralTypesOverloads03.ts(31,18): error TS2454: Variable 'world' is used before being assigned.
stringLiteralTypesOverloads03.ts(32,18): error TS2454: Variable 'helloOrWorld' is used before being assigned.
stringLiteralTypesOverloads03.ts(42,18): error TS2454: Variable 'hello' is used before being assigned.
stringLiteralTypesOverloads03.ts(43,18): error TS2454: Variable 'world' is used before being assigned.
stringLiteralTypesOverloads03.ts(44,18): error TS2454: Variable 'helloOrWorld' is used before being assigned.


==== stringLiteralTypesOverloads03.ts (6 errors) ====
    interface Base {
        x: string;
        y: number;
    }
    
    interface HelloOrWorld extends Base {
        p1: boolean;
    }
    
    interface JustHello extends Base {
        p2: boolean;
    }
    
    interface JustWorld extends Base {
        p3: boolean;
    }
    
    let hello: "hello";
    let world: "world";
    let helloOrWorld: "hello" | "world";
    
    function f(p: "hello"): JustHello;
    function f(p: "hello" | "world"): HelloOrWorld;
    function f(p: "world"): JustWorld;
    function f(p: string): Base;
    function f(...args: any[]): any {
        return undefined;
    }
    
    let fResult1 = f(hello);
                     ~~~~~
!!! error TS2454: Variable 'hello' is used before being assigned.
    let fResult2 = f(world);
                     ~~~~~
!!! error TS2454: Variable 'world' is used before being assigned.
    let fResult3 = f(helloOrWorld);
                     ~~~~~~~~~~~~
!!! error TS2454: Variable 'helloOrWorld' is used before being assigned.
    
    function g(p: string): Base;
    function g(p: "hello"): JustHello;
    function g(p: "hello" | "world"): HelloOrWorld;
    function g(p: "world"): JustWorld;
    function g(...args: any[]): any {
        return undefined;
    }
    
    let gResult1 = g(hello);
                     ~~~~~
!!! error TS2454: Variable 'hello' is used before being assigned.
    let gResult2 = g(world);
                     ~~~~~
!!! error TS2454: Variable 'world' is used before being assigned.
    let gResult3 = g(helloOrWorld);
                     ~~~~~~~~~~~~
!!! error TS2454: Variable 'helloOrWorld' is used before being assigned.