@@ -67,7 +67,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
67
67
var ts;
68
68
(function (ts) {
69
69
ts.versionMajorMinor = "3.6";
70
- ts.version = ts.versionMajorMinor + ".1-rc ";
70
+ ts.version = ts.versionMajorMinor + ".2 ";
71
71
})(ts || (ts = {}));
72
72
(function (ts) {
73
73
ts.emptyArray = [];
@@ -38588,8 +38588,7 @@ var ts;
38588
38588
var visited;
38589
38589
var bivariant = false;
38590
38590
var propagationType;
38591
- var inferenceMatch = false;
38592
- var inferenceIncomplete = false;
38591
+ var inferencePriority = 256;
38593
38592
var allowComplexConstraintInference = true;
38594
38593
inferFromTypes(originalSource, originalTarget);
38595
38594
function inferFromTypes(source, target) {
@@ -38679,7 +38678,7 @@ var ts;
38679
38678
clearCachedInferences(inferences);
38680
38679
}
38681
38680
}
38682
- inferenceMatch = true ;
38681
+ inferencePriority = Math.min(inferencePriority, priority) ;
38683
38682
return;
38684
38683
}
38685
38684
else {
@@ -38757,21 +38756,15 @@ var ts;
38757
38756
var key = source.id + "," + target.id;
38758
38757
var status = visited && visited.get(key);
38759
38758
if (status !== undefined) {
38760
- if (status & 1)
38761
- inferenceMatch = true;
38762
- if (status & 2)
38763
- inferenceIncomplete = true;
38759
+ inferencePriority = Math.min(inferencePriority, status);
38764
38760
return;
38765
38761
}
38766
- (visited || (visited = ts.createMap())).set(key, 0);
38767
- var saveInferenceMatch = inferenceMatch;
38768
- var saveInferenceIncomplete = inferenceIncomplete;
38769
- inferenceMatch = false;
38770
- inferenceIncomplete = false;
38762
+ (visited || (visited = ts.createMap())).set(key, -1);
38763
+ var saveInferencePriority = inferencePriority;
38764
+ inferencePriority = 256;
38771
38765
action(source, target);
38772
- visited.set(key, (inferenceMatch ? 1 : 0) | (inferenceIncomplete ? 2 : 0));
38773
- inferenceMatch = inferenceMatch || saveInferenceMatch;
38774
- inferenceIncomplete = inferenceIncomplete || saveInferenceIncomplete;
38766
+ visited.set(key, inferencePriority);
38767
+ inferencePriority = Math.min(inferencePriority, saveInferencePriority);
38775
38768
}
38776
38769
function inferFromMatchingType(source, targets, matches) {
38777
38770
var matched = false;
@@ -38841,8 +38834,7 @@ var ts;
38841
38834
var nakedTypeVariable = void 0;
38842
38835
var sources = source.flags & 1048576 ? source.types : [source];
38843
38836
var matched_1 = new Array(sources.length);
38844
- var saveInferenceIncomplete = inferenceIncomplete;
38845
- inferenceIncomplete = false;
38837
+ var inferenceCircularity = false;
38846
38838
for (var _i = 0, targets_3 = targets; _i < targets_3.length; _i++) {
38847
38839
var t = targets_3[_i];
38848
38840
if (getInferenceInfoForType(t)) {
@@ -38851,18 +38843,17 @@ var ts;
38851
38843
}
38852
38844
else {
38853
38845
for (var i = 0; i < sources.length; i++) {
38854
- var saveInferenceMatch = inferenceMatch ;
38855
- inferenceMatch = false ;
38846
+ var saveInferencePriority = inferencePriority ;
38847
+ inferencePriority = 256 ;
38856
38848
inferFromTypes(sources[i], t);
38857
- if (inferenceMatch )
38849
+ if (inferencePriority === priority )
38858
38850
matched_1[i] = true;
38859
- inferenceMatch = inferenceMatch || saveInferenceMatch;
38851
+ inferenceCircularity = inferenceCircularity || inferencePriority === -1;
38852
+ inferencePriority = Math.min(inferencePriority, saveInferencePriority);
38860
38853
}
38861
38854
}
38862
38855
}
38863
- var inferenceComplete = !inferenceIncomplete;
38864
- inferenceIncomplete = inferenceIncomplete || saveInferenceIncomplete;
38865
- if (typeVariableCount === 1 && inferenceComplete) {
38856
+ if (typeVariableCount === 1 && !inferenceCircularity) {
38866
38857
var unmatched = ts.flatMap(sources, function (s, i) { return matched_1[i] ? undefined : s; });
38867
38858
if (unmatched.length) {
38868
38859
inferFromTypes(getUnionType(unmatched), nakedTypeVariable);
@@ -38940,7 +38931,7 @@ var ts;
38940
38931
var symbol = isNonConstructorObject ? target.symbol : undefined;
38941
38932
if (symbol) {
38942
38933
if (ts.contains(symbolStack, symbol)) {
38943
- inferenceIncomplete = true ;
38934
+ inferencePriority = -1 ;
38944
38935
return;
38945
38936
}
38946
38937
(symbolStack || (symbolStack = [])).push(symbol);
0 commit comments