Skip to content

Commit 9aa5443

Browse files
committed
Fix printing of deferred mapped types' index signatures
1 parent 81a601b commit 9aa5443

3 files changed

Lines changed: 27 additions & 27 deletions

File tree

‎src/compiler/checker.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2860,7 +2860,7 @@ namespace ts {
28602860
for (const signature of resolvedType.constructSignatures) {
28612861
typeElements.push(<ConstructSignatureDeclaration>signatureToSignatureDeclarationHelper(signature, SyntaxKind.ConstructSignature, context));
28622862
}
2863-
if (resolvedType.stringIndexInfo && !(resolvedType.objectFlags & ObjectFlags.Deferred)) {
2863+
if (resolvedType.stringIndexInfo) {
28642864
const indexInfo = resolvedType.objectFlags & ObjectFlags.Deferred ?
28652865
createIndexInfo(emptyObjectType, resolvedType.stringIndexInfo.isReadonly, resolvedType.stringIndexInfo.declaration) :
28662866
resolvedType.stringIndexInfo;

‎tests/baselines/reference/isomorphicMappedTypeInference.types‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,15 +391,15 @@ function f6(s: string) {
391391

392392
});
393393
let v = unboxify(b);
394-
>v : {}
395-
>unboxify(b) : {}
394+
>v : { [x: string]: {}; }
395+
>unboxify(b) : { [x: string]: {}; }
396396
>unboxify : <T>(obj: Boxified<T>) => T
397397
>b : { [x: string]: Box<number> | Box<string> | Box<boolean>; }
398398

399399
let x: string | number | boolean = v[s];
400400
>x : string | number | boolean
401401
>v[s] : string | number | boolean
402-
>v : {}
402+
>v : { [x: string]: {}; }
403403
>s : string
404404
}
405405

‎tests/baselines/reference/mappedTypeRecursiveInference.types‎

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -71,37 +71,37 @@ declare let b: B;
7171
>B : B
7272

7373
const oub = foo(b);
74-
>oub : {}
75-
>foo(b) : {}
74+
>oub : { [x: string]: {}; }
75+
>foo(b) : { [x: string]: {}; }
7676
>foo : <T>(deep: Deep<T>) => T
7777
>b : B
7878

7979
oub.b
80-
>oub.b : {}
81-
>oub : {}
82-
>b : {}
80+
>oub.b : { [x: string]: {}; }
81+
>oub : { [x: string]: {}; }
82+
>b : { [x: string]: {}; }
8383

8484
oub.b.b
85-
>oub.b.b : {}
86-
>oub.b : {}
87-
>oub : {}
88-
>b : {}
89-
>b : {}
85+
>oub.b.b : { [x: string]: {}; }
86+
>oub.b : { [x: string]: {}; }
87+
>oub : { [x: string]: {}; }
88+
>b : { [x: string]: {}; }
89+
>b : { [x: string]: {}; }
9090

9191
oub.b.a.n.a.n.a
92-
>oub.b.a.n.a.n.a : {}
93-
>oub.b.a.n.a.n : {}
94-
>oub.b.a.n.a : {}
95-
>oub.b.a.n : {}
96-
>oub.b.a : {}
97-
>oub.b : {}
98-
>oub : {}
99-
>b : {}
100-
>a : {}
101-
>n : {}
102-
>a : {}
103-
>n : {}
104-
>a : {}
92+
>oub.b.a.n.a.n.a : { [x: string]: {}; }
93+
>oub.b.a.n.a.n : { [x: string]: {}; }
94+
>oub.b.a.n.a : { [x: string]: {}; }
95+
>oub.b.a.n : { [x: string]: {}; }
96+
>oub.b.a : { [x: string]: {}; }
97+
>oub.b : { [x: string]: {}; }
98+
>oub : { [x: string]: {}; }
99+
>b : { [x: string]: {}; }
100+
>a : { [x: string]: {}; }
101+
>n : { [x: string]: {}; }
102+
>a : { [x: string]: {}; }
103+
>n : { [x: string]: {}; }
104+
>a : { [x: string]: {}; }
105105

106106
let xhr: XMLHttpRequest;
107107
>xhr : XMLHttpRequest

0 commit comments

Comments
 (0)