Skip to content

Commit 14c1e62

Browse files
Added tests to show when teh literal is preserved and when not.
1 parent a6c7559 commit 14c1e62

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

tests/cases/compiler/verbatimDeclarationConstLiterals.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,19 @@ enum E { "some value" = 1 };
66
const e: typeof E["some value"] = E["some value"];
77

88
declare function f3<T>(a: T, b: T): T;
9-
const x3 = f3("abc", "def"); // "abc" | "def"
9+
const x3 = f3("abc", "def"); // "abc" | "def"
10+
11+
const octal = 0o16;
12+
const octalIndirect = octal;
13+
14+
const hex = 0x10;
15+
const hexIndirect = hex;
16+
17+
const seps = 1_000_000;
18+
const sepsIndirect = seps;
19+
20+
const singleQuote = 'x'
21+
const singleQuoteIndirect = singleQuote;
22+
23+
const noSubstTemplate = `Test`
24+
const noSubstTemplateIndirect = noSubstTemplate;

0 commit comments

Comments
 (0)