File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -8318,6 +8318,16 @@ namespace ts {
8318
8318
if (!couldContainTypeParameters(target)) {
8319
8319
return;
8320
8320
}
8321
+ if (source.aliasSymbol && source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol) {
8322
+ // Source and target are types originating in the same generic type alias declaration.
8323
+ // Simply infer from source type arguments to target type arguments.
8324
+ const sourceTypes = source.aliasTypeArguments;
8325
+ const targetTypes = target.aliasTypeArguments;
8326
+ for (let i = 0; i < sourceTypes.length; i++) {
8327
+ inferFromTypes(sourceTypes[i], targetTypes[i]);
8328
+ }
8329
+ return;
8330
+ }
8321
8331
if (source.flags & TypeFlags.Union && target.flags & TypeFlags.Union && !(source.flags & TypeFlags.Enum && target.flags & TypeFlags.Enum) ||
8322
8332
source.flags & TypeFlags.Intersection && target.flags & TypeFlags.Intersection) {
8323
8333
// Source and target are both unions or both intersections. If source and target
You can’t perform that action at this time.
0 commit comments