Mapped type { [P in any]: T } should yield { [x: string]: T }

This commit is contained in:
Anders Hejlsberg 2017-10-14 09:53:51 -07:00
parent 07ff0fdb81
commit fa65bd2062

View file

@ -5821,7 +5821,7 @@ namespace ts {
prop.syntheticLiteralTypeOrigin = t as StringLiteralType;
members.set(propName, prop);
}
else if (t.flags & TypeFlags.String) {
else if (t.flags & (TypeFlags.Any | TypeFlags.String)) {
stringIndexInfo = createIndexInfo(propType, templateReadonly);
}
}