30 lines
1.8 KiB
Text
30 lines
1.8 KiB
Text
=== tests/cases/compiler/declFileTypeAnnotationStringLiteral.ts ===
|
|
|
|
function foo(a: "hello"): number;
|
|
>foo : Symbol(foo, Decl(declFileTypeAnnotationStringLiteral.ts, 0, 0), Decl(declFileTypeAnnotationStringLiteral.ts, 1, 33), Decl(declFileTypeAnnotationStringLiteral.ts, 2, 32), Decl(declFileTypeAnnotationStringLiteral.ts, 3, 41))
|
|
>a : Symbol(a, Decl(declFileTypeAnnotationStringLiteral.ts, 1, 13))
|
|
|
|
function foo(a: "name"): string;
|
|
>foo : Symbol(foo, Decl(declFileTypeAnnotationStringLiteral.ts, 0, 0), Decl(declFileTypeAnnotationStringLiteral.ts, 1, 33), Decl(declFileTypeAnnotationStringLiteral.ts, 2, 32), Decl(declFileTypeAnnotationStringLiteral.ts, 3, 41))
|
|
>a : Symbol(a, Decl(declFileTypeAnnotationStringLiteral.ts, 2, 13))
|
|
|
|
function foo(a: string): string | number;
|
|
>foo : Symbol(foo, Decl(declFileTypeAnnotationStringLiteral.ts, 0, 0), Decl(declFileTypeAnnotationStringLiteral.ts, 1, 33), Decl(declFileTypeAnnotationStringLiteral.ts, 2, 32), Decl(declFileTypeAnnotationStringLiteral.ts, 3, 41))
|
|
>a : Symbol(a, Decl(declFileTypeAnnotationStringLiteral.ts, 3, 13))
|
|
|
|
function foo(a: string): string | number {
|
|
>foo : Symbol(foo, Decl(declFileTypeAnnotationStringLiteral.ts, 0, 0), Decl(declFileTypeAnnotationStringLiteral.ts, 1, 33), Decl(declFileTypeAnnotationStringLiteral.ts, 2, 32), Decl(declFileTypeAnnotationStringLiteral.ts, 3, 41))
|
|
>a : Symbol(a, Decl(declFileTypeAnnotationStringLiteral.ts, 4, 13))
|
|
|
|
if (a === "hello") {
|
|
>a : Symbol(a, Decl(declFileTypeAnnotationStringLiteral.ts, 4, 13))
|
|
|
|
return a.length;
|
|
>a.length : Symbol(String.length, Decl(lib.d.ts, 414, 19))
|
|
>a : Symbol(a, Decl(declFileTypeAnnotationStringLiteral.ts, 4, 13))
|
|
>length : Symbol(String.length, Decl(lib.d.ts, 414, 19))
|
|
}
|
|
|
|
return a;
|
|
>a : Symbol(a, Decl(declFileTypeAnnotationStringLiteral.ts, 4, 13))
|
|
}
|