We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 86d0fa2 commit 44a6c6cCopy full SHA for 44a6c6c
src/compiler/checker.ts
@@ -9614,6 +9614,11 @@ namespace ts {
9614
if (sourceInfo) {
9615
return indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors);
9616
}
9617
+ if (isGenericMappedType(source)) {
9618
+ // A generic mapped type { [P in K]: T } is related to an index signature { [x: string]: U }
9619
+ // if T is related to U.
9620
+ return kind === IndexKind.String && isRelatedTo(getTemplateTypeFromMappedType(<MappedType>source), targetInfo.type, reportErrors);
9621
+ }
9622
if (isObjectLiteralType(source)) {
9623
let related = Ternary.True;
9624
if (kind === IndexKind.String) {
0 commit comments