Skip to content

Commit d294524

Browse files
Accepted baselines.
1 parent 38090c6 commit d294524

4 files changed

+65
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings01.ts(2,5): error TS2322: Type 'string' is not assignable to type '"ABC"'.
2+
tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings01.ts(3,5): error TS2322: Type 'string' is not assignable to type '"DE\nF"'.
3+
tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings01.ts(6,5): error TS2322: Type 'string' is not assignable to type '"JK`L"'.
4+
5+
6+
==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings01.ts (3 errors) ====
7+
8+
let ABC: "ABC" = `ABC`;
9+
~~~
10+
!!! error TS2322: Type 'string' is not assignable to type '"ABC"'.
11+
let DE_NEWLINE_F: "DE\nF" = `DE
12+
~~~~~~~~~~~~
13+
!!! error TS2322: Type 'string' is not assignable to type '"DE\nF"'.
14+
F`;
15+
let G_QUOTE_HI: 'G"HI';
16+
let JK_BACKTICK_L: "JK`L" = `JK\`L`;
17+
~~~~~~~~~~~~~
18+
!!! error TS2322: Type 'string' is not assignable to type '"JK`L"'.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//// [stringLiteralTypesWithTemplateStrings01.ts]
2+
3+
let ABC: "ABC" = `ABC`;
4+
let DE_NEWLINE_F: "DE\nF" = `DE
5+
F`;
6+
let G_QUOTE_HI: 'G"HI';
7+
let JK_BACKTICK_L: "JK`L" = `JK\`L`;
8+
9+
//// [stringLiteralTypesWithTemplateStrings01.js]
10+
var ABC = "ABC";
11+
var DE_NEWLINE_F = "DE\nF";
12+
var G_QUOTE_HI;
13+
var JK_BACKTICK_L = "JK`L";
14+
15+
16+
//// [stringLiteralTypesWithTemplateStrings01.d.ts]
17+
declare let ABC: "ABC";
18+
declare let DE_NEWLINE_F: "DE\nF";
19+
declare let G_QUOTE_HI: 'G"HI';
20+
declare let JK_BACKTICK_L: "JK`L";
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings02.ts(2,5): error TS2322: Type 'string' is not assignable to type '"AB\r\nC"'.
2+
tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings02.ts(4,5): error TS2322: Type 'string' is not assignable to type '"DE\nF"'.
3+
4+
5+
==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings02.ts (2 errors) ====
6+
7+
let abc: "AB\r\nC" = `AB
8+
~~~
9+
!!! error TS2322: Type 'string' is not assignable to type '"AB\r\nC"'.
10+
C`;
11+
let de_NEWLINE_f: "DE\nF" = `DE${"\n"}F`;
12+
~~~~~~~~~~~~
13+
!!! error TS2322: Type 'string' is not assignable to type '"DE\nF"'.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//// [stringLiteralTypesWithTemplateStrings02.ts]
2+
3+
let abc: "AB\r\nC" = `AB
4+
C`;
5+
let de_NEWLINE_f: "DE\nF" = `DE${"\n"}F`;
6+
7+
//// [stringLiteralTypesWithTemplateStrings02.js]
8+
var abc = "AB\nC";
9+
var de_NEWLINE_f = "DE" + "\n" + "F";
10+
11+
12+
//// [stringLiteralTypesWithTemplateStrings02.d.ts]
13+
declare let abc: "AB\r\nC";
14+
declare let de_NEWLINE_f: "DE\nF";

0 commit comments

Comments
 (0)