diff --git a/tests/baselines/reference/forOfStringConstituents.js b/tests/baselines/reference/forOfStringConstituents.js new file mode 100644 index 00000000000..0f0d86d8cc6 --- /dev/null +++ b/tests/baselines/reference/forOfStringConstituents.js @@ -0,0 +1,15 @@ +//// [forOfStringConstituents.ts] +interface A { x: 0; y: C[]; } +interface B { x: 1; y: CD[]; } +interface C { x: 2; } +interface D { x: 3; } +type AB = A | B; +type CD = C | D; +declare let x: AB, y: CD; +for (y of x.y); + +//// [forOfStringConstituents.js] +for (var _i = 0, _a = x.y; _i < _a.length; _i++) { + y = _a[_i]; + ; +} diff --git a/tests/baselines/reference/forOfStringConstituents.symbols b/tests/baselines/reference/forOfStringConstituents.symbols new file mode 100644 index 00000000000..226f8e35a55 --- /dev/null +++ b/tests/baselines/reference/forOfStringConstituents.symbols @@ -0,0 +1,43 @@ +=== tests/cases/compiler/forOfStringConstituents.ts === +interface A { x: 0; y: C[]; } +>A : Symbol(A, Decl(forOfStringConstituents.ts, 0, 0)) +>x : Symbol(A.x, Decl(forOfStringConstituents.ts, 0, 13)) +>y : Symbol(A.y, Decl(forOfStringConstituents.ts, 0, 19)) +>C : Symbol(C, Decl(forOfStringConstituents.ts, 1, 30)) + +interface B { x: 1; y: CD[]; } +>B : Symbol(B, Decl(forOfStringConstituents.ts, 0, 29)) +>x : Symbol(B.x, Decl(forOfStringConstituents.ts, 1, 13)) +>y : Symbol(B.y, Decl(forOfStringConstituents.ts, 1, 19)) +>CD : Symbol(CD, Decl(forOfStringConstituents.ts, 4, 16)) + +interface C { x: 2; } +>C : Symbol(C, Decl(forOfStringConstituents.ts, 1, 30)) +>x : Symbol(C.x, Decl(forOfStringConstituents.ts, 2, 13)) + +interface D { x: 3; } +>D : Symbol(D, Decl(forOfStringConstituents.ts, 2, 21)) +>x : Symbol(D.x, Decl(forOfStringConstituents.ts, 3, 13)) + +type AB = A | B; +>AB : Symbol(AB, Decl(forOfStringConstituents.ts, 3, 21)) +>A : Symbol(A, Decl(forOfStringConstituents.ts, 0, 0)) +>B : Symbol(B, Decl(forOfStringConstituents.ts, 0, 29)) + +type CD = C | D; +>CD : Symbol(CD, Decl(forOfStringConstituents.ts, 4, 16)) +>C : Symbol(C, Decl(forOfStringConstituents.ts, 1, 30)) +>D : Symbol(D, Decl(forOfStringConstituents.ts, 2, 21)) + +declare let x: AB, y: CD; +>x : Symbol(x, Decl(forOfStringConstituents.ts, 6, 11)) +>AB : Symbol(AB, Decl(forOfStringConstituents.ts, 3, 21)) +>y : Symbol(y, Decl(forOfStringConstituents.ts, 6, 18)) +>CD : Symbol(CD, Decl(forOfStringConstituents.ts, 4, 16)) + +for (y of x.y); +>y : Symbol(y, Decl(forOfStringConstituents.ts, 6, 18)) +>x.y : Symbol(y, Decl(forOfStringConstituents.ts, 0, 19), Decl(forOfStringConstituents.ts, 1, 19)) +>x : Symbol(x, Decl(forOfStringConstituents.ts, 6, 11)) +>y : Symbol(y, Decl(forOfStringConstituents.ts, 0, 19), Decl(forOfStringConstituents.ts, 1, 19)) + diff --git a/tests/baselines/reference/forOfStringConstituents.types b/tests/baselines/reference/forOfStringConstituents.types new file mode 100644 index 00000000000..2bd2a1abd4e --- /dev/null +++ b/tests/baselines/reference/forOfStringConstituents.types @@ -0,0 +1,43 @@ +=== tests/cases/compiler/forOfStringConstituents.ts === +interface A { x: 0; y: C[]; } +>A : A +>x : 0 +>y : C[] +>C : C + +interface B { x: 1; y: CD[]; } +>B : B +>x : 1 +>y : CD[] +>CD : CD + +interface C { x: 2; } +>C : C +>x : 2 + +interface D { x: 3; } +>D : D +>x : 3 + +type AB = A | B; +>AB : AB +>A : A +>B : B + +type CD = C | D; +>CD : CD +>C : C +>D : D + +declare let x: AB, y: CD; +>x : AB +>AB : AB +>y : CD +>CD : CD + +for (y of x.y); +>y : CD +>x.y : C[] | CD[] +>x : AB +>y : C[] | CD[] +