Skip to content

Commit 1e41af3

Browse files
committed
Update LKG
1 parent 473f406 commit 1e41af3

File tree

5 files changed

+11
-13
lines changed

5 files changed

+11
-13
lines changed

lib/tsc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18090,7 +18090,7 @@ var ts;
1809018090
inferFromTypes(source, t);
1809118091
}
1809218092
}
18093-
if (target.flags & 16384 && typeParameterCount === 1) {
18093+
if (typeParameterCount === 1) {
1809418094
inferiority++;
1809518095
inferFromTypes(source, typeParameter);
1809618096
inferiority--;

lib/tsserver.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18854,7 +18854,7 @@ var ts;
1885418854
inferFromTypes(source, t);
1885518855
}
1885618856
}
18857-
if (target.flags & 16384 && typeParameterCount === 1) {
18857+
if (typeParameterCount === 1) {
1885818858
inferiority++;
1885918859
inferFromTypes(source, typeParameter);
1886018860
inferiority--;

lib/tsserverlibrary.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18854,7 +18854,7 @@ var ts;
1885418854
inferFromTypes(source, t);
1885518855
}
1885618856
}
18857-
if (target.flags & 16384 && typeParameterCount === 1) {
18857+
if (typeParameterCount === 1) {
1885818858
inferiority++;
1885918859
inferFromTypes(source, typeParameter);
1886018860
inferiority--;

lib/typescript.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -21958,11 +21958,10 @@ var ts;
2195821958
inferFromTypes(source, t);
2195921959
}
2196021960
}
21961-
// Next, if target is a union type containing a single naked type parameter, make a
21962-
// secondary inference to that type parameter. We don't do this for intersection types
21963-
// because in a target type like Foo & T we don't know how which parts of the source type
21964-
// should be matched by Foo and which should be inferred to T.
21965-
if (target.flags & 16384 /* Union */ && typeParameterCount === 1) {
21961+
// Next, if target containings a single naked type parameter, make a secondary inference to that type
21962+
// parameter. This gives meaningful results for union types in co-variant positions and intersection
21963+
// types in contra-variant positions (such as callback parameters).
21964+
if (typeParameterCount === 1) {
2196621965
inferiority++;
2196721966
inferFromTypes(source, typeParameter);
2196821967
inferiority--;

lib/typescriptServices.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -21958,11 +21958,10 @@ var ts;
2195821958
inferFromTypes(source, t);
2195921959
}
2196021960
}
21961-
// Next, if target is a union type containing a single naked type parameter, make a
21962-
// secondary inference to that type parameter. We don't do this for intersection types
21963-
// because in a target type like Foo & T we don't know how which parts of the source type
21964-
// should be matched by Foo and which should be inferred to T.
21965-
if (target.flags & 16384 /* Union */ && typeParameterCount === 1) {
21961+
// Next, if target containings a single naked type parameter, make a secondary inference to that type
21962+
// parameter. This gives meaningful results for union types in co-variant positions and intersection
21963+
// types in contra-variant positions (such as callback parameters).
21964+
if (typeParameterCount === 1) {
2196621965
inferiority++;
2196721966
inferFromTypes(source, typeParameter);
2196821967
inferiority--;

0 commit comments

Comments
 (0)