36 lines
525 B
Text
36 lines
525 B
Text
=== tests/cases/compiler/functionReturn.ts ===
|
|
|
|
function f0(): void { }
|
|
>f0 : () => void
|
|
|
|
function f1() {
|
|
>f1 : () => void
|
|
|
|
var n: any = f0();
|
|
>n : any
|
|
>f0() : void
|
|
>f0 : () => void
|
|
}
|
|
function f2(): any { }
|
|
>f2 : () => any
|
|
|
|
function f3(): string { return; }
|
|
>f3 : () => string
|
|
|
|
function f4(): string {
|
|
>f4 : () => string
|
|
|
|
return '';
|
|
>'' : string
|
|
|
|
return;
|
|
}
|
|
function f5(): string {
|
|
>f5 : () => string
|
|
|
|
return '';
|
|
>'' : string
|
|
|
|
return undefined;
|
|
>undefined : undefined
|
|
}
|