Fix index signatures on unions of intersections (#38278)

* Add missing getApparentType call

* Add regression tests
This commit is contained in:
Anders Hejlsberg
2020-05-04 12:46:14 -07:00
committed by GitHub
parent 5e0e254ef7
commit a09470f013
5 changed files with 210 additions and 1 deletions

View File

@@ -9701,7 +9701,7 @@ namespace ts {
const indexTypes: Type[] = [];
let isAnyReadonly = false;
for (const type of types) {
const indexInfo = getIndexInfoOfType(type, kind);
const indexInfo = getIndexInfoOfType(getApparentType(type), kind);
if (!indexInfo) {
return undefined;
}