File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8318,6 +8318,16 @@ namespace ts {
83188318 if (!couldContainTypeParameters(target)) {
83198319 return;
83208320 }
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+ }
83218331 if (source.flags & TypeFlags.Union && target.flags & TypeFlags.Union && !(source.flags & TypeFlags.Enum && target.flags & TypeFlags.Enum) ||
83228332 source.flags & TypeFlags.Intersection && target.flags & TypeFlags.Intersection) {
83238333 // 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