File tree Expand file tree Collapse file tree 5 files changed +11
-13
lines changed
Expand file tree Collapse file tree 5 files changed +11
-13
lines changed Original file line number Diff line number Diff 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--;
Original file line number Diff line number Diff 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--;
Original file line number Diff line number Diff 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--;
Original file line number Diff line number Diff 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--;
Original file line number Diff line number Diff 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--;
You can’t perform that action at this time.
0 commit comments