==== tests/cases/compiler/recursiveFunctionTypes.ts (18 errors) ====
    function fn(): typeof fn { return 1; }
                                      ~
!!! recursiveFunctionTypes.ts(1,35): error TS2012: Cannot convert 'number' to 'typeof fn':
!!! 	Type 'typeof fn' requires a call signature, but type 'Number' lacks one.
    
    var x: number = fn; // error
        ~~~~~~~~~~~~~~
!!! recursiveFunctionTypes.ts(3,5): error TS2011: Cannot convert 'typeof fn' to 'number'.
    var y: () => number = fn; // ok
        ~~~~~~~~~~~~~~~~~~~~
!!! recursiveFunctionTypes.ts(4,5): error TS2012: Cannot convert 'typeof fn' to '() => number':
!!! 	Call signatures of types 'typeof fn' and '() => number' are incompatible.
    
    var f: () => typeof g;
    var g: () => typeof f;
    
    function f1(d: typeof f1) { }
    
    function f2(): typeof g2 { } 
                   ~~~~~~~~~
!!! recursiveFunctionTypes.ts(11,16): error TS2131: Function declared a non-void return type, but has no return expression.
    function g2(): typeof f2 { } 
                   ~~~~~~~~~
!!! recursiveFunctionTypes.ts(12,16): error TS2131: Function declared a non-void return type, but has no return expression.
    
    interface I<T> { }
    function f3(): I<typeof f3> { return f3; }
    
    var a: number = f3; // error
        ~~~~~~~~~~~~~~
!!! recursiveFunctionTypes.ts(17,5): error TS2011: Cannot convert 'typeof f3' to 'number'.
    
    class C {
         static g(t: typeof C.g){ }
    }
    C.g(3); // error
      ~
!!! recursiveFunctionTypes.ts(22,3): error TS2082: Supplied parameters do not match any signature of call target:
!!! 	Type '(t: any) => void' requires a call signature, but type 'Number' lacks one.
      ~
!!! recursiveFunctionTypes.ts(22,3): error TS2087: Could not select overload for 'call' expression.
    
    var f4: () => typeof f4;
    f4 = 3; // error
    ~~
!!! recursiveFunctionTypes.ts(25,1): error TS2012: Cannot convert 'number' to '() => any':
!!! 	Type '() => any' requires a call signature, but type 'Number' lacks one.
    
    function f5() { return f5; }
    
    function f6(): typeof f6;
    function f6(a: typeof f6): () => number;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! recursiveFunctionTypes.ts(30,1): error TS2149: Overload signature is not compatible with function definition:
!!! 	Call signatures of types 'typeof f6' and '() => number' are incompatible.
    function f6(a?: any) { return f6; }
    
    f6("", 3); // error (arity mismatch)
    ~~
!!! recursiveFunctionTypes.ts(33,1): error TS2081: Supplied parameters do not match any signature of call target.
    ~~
!!! recursiveFunctionTypes.ts(33,1): error TS2087: Could not select overload for 'call' expression.
    f6(""); // ok (function takes an any param)
    ~~
!!! recursiveFunctionTypes.ts(34,1): error TS2082: Supplied parameters do not match any signature of call target:
!!! 	Type 'typeof f6' requires a call signature, but type 'String' lacks one.
    ~~
!!! recursiveFunctionTypes.ts(34,1): error TS2087: Could not select overload for 'call' expression.
    f6(); // ok
    
    declare function f7(): typeof f7;
    declare function f7(a: typeof f7): () => number;
    declare function f7(a: number): number;
    declare function f7(a?: typeof f7): typeof f7;
    
    f7("", 3); // error (arity mismatch)
    ~~
!!! recursiveFunctionTypes.ts(42,1): error TS2081: Supplied parameters do not match any signature of call target.
    ~~
!!! recursiveFunctionTypes.ts(42,1): error TS2087: Could not select overload for 'call' expression.
    f7(""); // ok (function takes an any param)
    ~~
!!! recursiveFunctionTypes.ts(43,1): error TS2082: Supplied parameters do not match any signature of call target:
!!! 	Type 'typeof f7' requires a call signature, but type 'String' lacks one.
    ~~
!!! recursiveFunctionTypes.ts(43,1): error TS2087: Could not select overload for 'call' expression.
    f7(); // ok