Skip to content

Commit 8118bec

Browse files
author
Ben Lichtman
committed
Update LKG
1 parent f28bdb4 commit 8118bec

9 files changed

+188
-195
lines changed

lib/tsc.js

+17-26
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
6767
var ts;
6868
(function (ts) {
6969
ts.versionMajorMinor = "3.6";
70-
ts.version = ts.versionMajorMinor + ".1-rc";
70+
ts.version = ts.versionMajorMinor + ".2";
7171
})(ts || (ts = {}));
7272
(function (ts) {
7373
ts.emptyArray = [];
@@ -38588,8 +38588,7 @@ var ts;
3858838588
var visited;
3858938589
var bivariant = false;
3859038590
var propagationType;
38591-
var inferenceMatch = false;
38592-
var inferenceIncomplete = false;
38591+
var inferencePriority = 256;
3859338592
var allowComplexConstraintInference = true;
3859438593
inferFromTypes(originalSource, originalTarget);
3859538594
function inferFromTypes(source, target) {
@@ -38679,7 +38678,7 @@ var ts;
3867938678
clearCachedInferences(inferences);
3868038679
}
3868138680
}
38682-
inferenceMatch = true;
38681+
inferencePriority = Math.min(inferencePriority, priority);
3868338682
return;
3868438683
}
3868538684
else {
@@ -38757,21 +38756,15 @@ var ts;
3875738756
var key = source.id + "," + target.id;
3875838757
var status = visited && visited.get(key);
3875938758
if (status !== undefined) {
38760-
if (status & 1)
38761-
inferenceMatch = true;
38762-
if (status & 2)
38763-
inferenceIncomplete = true;
38759+
inferencePriority = Math.min(inferencePriority, status);
3876438760
return;
3876538761
}
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;
3877138765
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);
3877538768
}
3877638769
function inferFromMatchingType(source, targets, matches) {
3877738770
var matched = false;
@@ -38841,8 +38834,7 @@ var ts;
3884138834
var nakedTypeVariable = void 0;
3884238835
var sources = source.flags & 1048576 ? source.types : [source];
3884338836
var matched_1 = new Array(sources.length);
38844-
var saveInferenceIncomplete = inferenceIncomplete;
38845-
inferenceIncomplete = false;
38837+
var inferenceCircularity = false;
3884638838
for (var _i = 0, targets_3 = targets; _i < targets_3.length; _i++) {
3884738839
var t = targets_3[_i];
3884838840
if (getInferenceInfoForType(t)) {
@@ -38851,18 +38843,17 @@ var ts;
3885138843
}
3885238844
else {
3885338845
for (var i = 0; i < sources.length; i++) {
38854-
var saveInferenceMatch = inferenceMatch;
38855-
inferenceMatch = false;
38846+
var saveInferencePriority = inferencePriority;
38847+
inferencePriority = 256;
3885638848
inferFromTypes(sources[i], t);
38857-
if (inferenceMatch)
38849+
if (inferencePriority === priority)
3885838850
matched_1[i] = true;
38859-
inferenceMatch = inferenceMatch || saveInferenceMatch;
38851+
inferenceCircularity = inferenceCircularity || inferencePriority === -1;
38852+
inferencePriority = Math.min(inferencePriority, saveInferencePriority);
3886038853
}
3886138854
}
3886238855
}
38863-
var inferenceComplete = !inferenceIncomplete;
38864-
inferenceIncomplete = inferenceIncomplete || saveInferenceIncomplete;
38865-
if (typeVariableCount === 1 && inferenceComplete) {
38856+
if (typeVariableCount === 1 && !inferenceCircularity) {
3886638857
var unmatched = ts.flatMap(sources, function (s, i) { return matched_1[i] ? undefined : s; });
3886738858
if (unmatched.length) {
3886838859
inferFromTypes(getUnionType(unmatched), nakedTypeVariable);
@@ -38940,7 +38931,7 @@ var ts;
3894038931
var symbol = isNonConstructorObject ? target.symbol : undefined;
3894138932
if (symbol) {
3894238933
if (ts.contains(symbolStack, symbol)) {
38943-
inferenceIncomplete = true;
38934+
inferencePriority = -1;
3894438935
return;
3894538936
}
3894638937
(symbolStack || (symbolStack = [])).push(symbol);

lib/tsserver.js

+34-34
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/tsserverlibrary.d.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -2441,7 +2441,9 @@ declare namespace ts {
24412441
LiteralKeyof = 32,
24422442
NoConstraints = 64,
24432443
AlwaysStrict = 128,
2444-
PriorityImpliesCombination = 56
2444+
MaxValue = 256,
2445+
PriorityImpliesCombination = 56,
2446+
Circularity = -1
24452447
}
24462448
/** @deprecated Use FileExtensionInfo instead. */
24472449
export type JsFileExtensionInfo = FileExtensionInfo;

0 commit comments

Comments
 (0)