2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/declFileTypeofFunction.ts ===
|
|
|
|
|
|
|
|
function f(n: typeof f): string;
|
|
|
|
>f : { (n: typeof f): string; (n: { (n: typeof g): number; (n: typeof f): number; }): string; }
|
|
|
|
>n : { (n: typeof f): string; (n: { (n: typeof g): number; (n: typeof f): number; }): string; }
|
|
|
|
>f : { (n: typeof f): string; (n: { (n: typeof g): number; (n: typeof f): number; }): string; }
|
|
|
|
|
|
|
|
function f(n: typeof g): string;
|
|
|
|
>f : { (n: typeof f): string; (n: { (n: typeof g): number; (n: typeof f): number; }): string; }
|
|
|
|
>n : { (n: typeof g): number; (n: { (n: typeof f): string; (n: typeof g): string; }): number; }
|
|
|
|
>g : { (n: typeof g): number; (n: { (n: typeof f): string; (n: typeof g): string; }): number; }
|
|
|
|
|
|
|
|
function f() { return undefined; }
|
|
|
|
>f : { (n: typeof f): string; (n: { (n: typeof g): number; (n: typeof f): number; }): string; }
|
|
|
|
>undefined : undefined
|
|
|
|
|
|
|
|
function g(n: typeof g): number;
|
|
|
|
>g : { (n: typeof g): number; (n: { (n: typeof f): string; (n: typeof g): string; }): number; }
|
|
|
|
>n : { (n: typeof g): number; (n: { (n: typeof f): string; (n: typeof g): string; }): number; }
|
|
|
|
>g : { (n: typeof g): number; (n: { (n: typeof f): string; (n: typeof g): string; }): number; }
|
|
|
|
|
|
|
|
function g(n: typeof f): number;
|
|
|
|
>g : { (n: typeof g): number; (n: { (n: typeof f): string; (n: typeof g): string; }): number; }
|
|
|
|
>n : { (n: typeof f): string; (n: { (n: typeof g): number; (n: typeof f): number; }): string; }
|
|
|
|
>f : { (n: typeof f): string; (n: { (n: typeof g): number; (n: typeof f): number; }): string; }
|
|
|
|
|
|
|
|
function g() { return undefined; }
|
|
|
|
>g : { (n: typeof g): number; (n: { (n: typeof f): string; (n: typeof g): string; }): number; }
|
|
|
|
>undefined : undefined
|
|
|
|
|
|
|
|
var b: () => typeof b;
|
2014-08-27 05:45:31 +02:00
|
|
|
>b : () => any
|
|
|
|
>b : () => any
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
function b1() {
|
|
|
|
>b1 : () => typeof b1
|
|
|
|
|
|
|
|
return b1;
|
|
|
|
>b1 : () => typeof b1
|
|
|
|
}
|
|
|
|
|
|
|
|
function foo(): typeof foo {
|
|
|
|
>foo : () => typeof foo
|
|
|
|
>foo : () => typeof foo
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
var foo1: typeof foo;
|
|
|
|
>foo1 : () => typeof foo
|
|
|
|
>foo : () => typeof foo
|
|
|
|
|
|
|
|
var foo2 = foo;
|
|
|
|
>foo2 : () => typeof foo
|
|
|
|
>foo : () => typeof foo
|
|
|
|
|
|
|
|
var foo3 = function () {
|
2014-09-05 22:05:36 +02:00
|
|
|
>foo3 : () => any
|
2014-08-22 03:39:46 +02:00
|
|
|
>function () { return foo3;} : () => any
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
return foo3;
|
2014-09-05 22:05:36 +02:00
|
|
|
>foo3 : () => any
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
var x = () => {
|
2014-09-05 22:05:36 +02:00
|
|
|
>x : () => any
|
2014-08-22 03:39:46 +02:00
|
|
|
>() => { return x;} : () => any
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
return x;
|
2014-09-05 22:05:36 +02:00
|
|
|
>x : () => any
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function foo5(x: number) {
|
|
|
|
>foo5 : (x: number) => (x: number) => number
|
|
|
|
>x : number
|
|
|
|
|
|
|
|
function bar(x: number) {
|
|
|
|
>bar : (x: number) => number
|
|
|
|
>x : number
|
|
|
|
|
|
|
|
return x;
|
|
|
|
>x : number
|
|
|
|
}
|
|
|
|
return bar;
|
|
|
|
>bar : (x: number) => number
|
|
|
|
}
|