TypeScript/tests/baselines/reference/declFileTypeAnnotationStringLiteral.types
2015-04-15 16:44:20 -07:00

33 lines
831 B
Plaintext

=== tests/cases/compiler/declFileTypeAnnotationStringLiteral.ts ===
function foo(a: "hello"): number;
>foo : { (a: "hello"): number; (a: "name"): string; (a: string): string | number; }
>a : "hello"
function foo(a: "name"): string;
>foo : { (a: "hello"): number; (a: "name"): string; (a: string): string | number; }
>a : "name"
function foo(a: string): string | number;
>foo : { (a: "hello"): number; (a: "name"): string; (a: string): string | number; }
>a : string
function foo(a: string): string | number {
>foo : { (a: "hello"): number; (a: "name"): string; (a: string): string | number; }
>a : string
if (a === "hello") {
>a === "hello" : boolean
>a : string
>"hello" : string
return a.length;
>a.length : number
>a : string
>length : number
}
return a;
>a : string
}