File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26810,7 +26810,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
2681026810 inference.priority = combinedPriority;
2681126811 }
2681226812 if (priority === (inference.priority & ~InferencePriority.DistributiveConditional)) {
26813- if (inference.priority !== combinedPriority) {
26813+ // "upgrade" the priority (by essentially removing DistributiveConditional bit) of the inference without discarding the collected candidates
26814+ if (inference.priority > combinedPriority) {
2681426815 inference.priority = combinedPriority;
2681526816 clearCachedInferences(inferences);
2681626817 }
@@ -27181,7 +27182,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
2718127182 function inferToConditionalType(source: Type, target: ConditionalType) {
2718227183 const info = target.root.isDistributive ? getInferenceInfoForType(getActualTypeVariable(target.checkType)) : undefined;
2718327184 const saveIndividualPriority = info?.individualPriority;
27184- if (info && !hasInferenceCandidates(info) ) {
27185+ if (info) {
2718527186 info.individualPriority = (info.individualPriority || InferencePriority.None) | InferencePriority.DistributiveConditional;
2718627187 }
2718727188 if (source.flags & TypeFlags.Conditional) {
You can’t perform that action at this time.
0 commit comments