Skip to content

Commit 771b42d

Browse files
committed
Don't linearly search for fresh param in getConditionalType
1 parent a280caf commit 771b42d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/compiler/checker.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17790,11 +17790,11 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
1779017790
const context = createInferenceContext(freshParams, /*signature*/ undefined, InferenceFlags.None);
1779117791
if (freshMapper) {
1779217792
const freshCombinedMapper = combineTypeMappers(mapper, freshMapper);
17793-
for (const p of freshParams) {
17794-
if (root.inferTypeParameters.indexOf(p) === -1) {
17793+
forEach(freshParams, (p, i) => {
17794+
if (p !== root.inferTypeParameters![i]) {
1779517795
p.mapper = freshCombinedMapper;
1779617796
}
17797-
}
17797+
});
1779817798
}
1779917799
if (!checkTypeDeferred) {
1780017800
// We don't want inferences from constraints as they may cause us to eagerly resolve the

0 commit comments

Comments
 (0)