TypeScript/tests/baselines/reference/functionReturn.types

36 lines
523 B
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/functionReturn.ts ===
function f0(): void { }
>f0 : () => void
2014-08-15 23:33:16 +02:00
function f1() {
>f1 : () => void
2014-08-15 23:33:16 +02:00
var n: any = f0();
>n : any
2014-08-15 23:33:16 +02:00
>f0() : void
>f0 : () => void
2014-08-15 23:33:16 +02:00
}
function f2(): any { }
>f2 : () => any
2014-08-15 23:33:16 +02:00
function f3(): string { return; }
>f3 : () => string
2014-08-15 23:33:16 +02:00
function f4(): string {
>f4 : () => string
2014-08-15 23:33:16 +02:00
return '';
2015-04-13 21:36:11 +02:00
>'' : string
2014-08-15 23:33:16 +02:00
return;
}
function f5(): string {
>f5 : () => string
2014-08-15 23:33:16 +02:00
return '';
2015-04-13 21:36:11 +02:00
>'' : string
2014-08-15 23:33:16 +02:00
return undefined;
>undefined : undefined
2014-08-15 23:33:16 +02:00
}