64 lines
837 B
Plaintext
64 lines
837 B
Plaintext
|
=== tests/cases/compiler/declFileTypeAnnotationBuiltInType.ts ===
|
||
|
|
||
|
// string
|
||
|
function foo(): string {
|
||
|
>foo : () => string
|
||
|
|
||
|
return "";
|
||
|
}
|
||
|
function foo2() {
|
||
|
>foo2 : () => string
|
||
|
|
||
|
return "";
|
||
|
}
|
||
|
|
||
|
// number
|
||
|
function foo3(): number {
|
||
|
>foo3 : () => number
|
||
|
|
||
|
return 10;
|
||
|
}
|
||
|
function foo4() {
|
||
|
>foo4 : () => number
|
||
|
|
||
|
return 10;
|
||
|
}
|
||
|
|
||
|
// boolean
|
||
|
function foo5(): boolean {
|
||
|
>foo5 : () => boolean
|
||
|
|
||
|
return true;
|
||
|
}
|
||
|
function foo6() {
|
||
|
>foo6 : () => boolean
|
||
|
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
// void
|
||
|
function foo7(): void {
|
||
|
>foo7 : () => void
|
||
|
|
||
|
return;
|
||
|
}
|
||
|
function foo8() {
|
||
|
>foo8 : () => void
|
||
|
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
// any
|
||
|
function foo9(): any {
|
||
|
>foo9 : () => any
|
||
|
|
||
|
return undefined;
|
||
|
>undefined : undefined
|
||
|
}
|
||
|
function foo10() {
|
||
|
>foo10 : () => any
|
||
|
|
||
|
return undefined;
|
||
|
>undefined : undefined
|
||
|
}
|