@@ -11401,23 +11401,6 @@ namespace ts {
11401
11401
}
11402
11402
return;
11403
11403
}
11404
- else if (target.flags & TypeFlags.IndexedAccess) {
11405
- const targetConstraint = (<IndexedAccessType>target).objectType;
11406
- const inference = getInferenceInfoForType(targetConstraint);
11407
- if (inference) {
11408
- if (!inference.isFixed) {
11409
- // Instantiates instance of `type PartialInference<T, Keys extends string> = ({[K in Keys]: {[K1 in K]: T}})[Keys];`
11410
- // Where `T` is `source` and `Keys` is `target.indexType`
11411
- const inferenceTypeSymbol = getGlobalSymbol("PartialInference" as __String, SymbolFlags.Type, Diagnostics.Cannot_find_global_type_0);
11412
- const inferenceType = getDeclaredTypeOfSymbol(inferenceTypeSymbol);
11413
- if (inferenceType !== unknownType) {
11414
- const mapper = createTypeMapper(getSymbolLinks(inferenceTypeSymbol).typeParameters, [source, (target as IndexedAccessType).indexType]);
11415
- (inference.indexes || (inference.indexes = [])).push(instantiateType(inferenceType, mapper));
11416
- }
11417
- }
11418
- return;
11419
- }
11420
- }
11421
11404
}
11422
11405
if (getObjectFlags(source) & ObjectFlags.Reference && getObjectFlags(target) & ObjectFlags.Reference && (<TypeReference>source).target === (<TypeReference>target).target) {
11423
11406
// If source and target are references to the same generic type, infer from type arguments
@@ -11449,6 +11432,23 @@ namespace ts {
11449
11432
inferFromTypes((<IndexedAccessType>source).objectType, (<IndexedAccessType>target).objectType);
11450
11433
inferFromTypes((<IndexedAccessType>source).indexType, (<IndexedAccessType>target).indexType);
11451
11434
}
11435
+ else if (target.flags & TypeFlags.IndexedAccess) {
11436
+ const targetConstraint = (<IndexedAccessType>target).objectType;
11437
+ const inference = getInferenceInfoForType(targetConstraint);
11438
+ if (inference) {
11439
+ if (!inference.isFixed) {
11440
+ // Instantiates instance of `type PartialInference<T, Keys extends string> = ({[K in Keys]: {[K1 in K]: T}})[Keys];`
11441
+ // Where `T` is `source` and `Keys` is `target.indexType`
11442
+ const inferenceTypeSymbol = getGlobalSymbol("PartialInference" as __String, SymbolFlags.Type, Diagnostics.Cannot_find_global_type_0);
11443
+ const inferenceType = getDeclaredTypeOfSymbol(inferenceTypeSymbol);
11444
+ if (inferenceType !== unknownType) {
11445
+ const mapper = createTypeMapper(getSymbolLinks(inferenceTypeSymbol).typeParameters, [source, (target as IndexedAccessType).indexType]);
11446
+ (inference.indexes || (inference.indexes = [])).push(instantiateType(inferenceType, mapper));
11447
+ }
11448
+ }
11449
+ return;
11450
+ }
11451
+ }
11452
11452
else if (target.flags & TypeFlags.UnionOrIntersection) {
11453
11453
const targetTypes = (<UnionOrIntersectionType>target).types;
11454
11454
let typeVariableCount = 0;
0 commit comments