File tree Expand file tree Collapse file tree 1 file changed +11
-15
lines changed Expand file tree Collapse file tree 1 file changed +11
-15
lines changed Original file line number Diff line number Diff line change @@ -9226,20 +9226,13 @@ namespace ts {
9226
9226
}
9227
9227
}
9228
9228
}
9229
- else if (target.flags & TypeFlags.Promised) {
9230
- // A promised S is related to a promised T if S is related to T
9231
- if (source.flags & TypeFlags.Promised) {
9232
- if (result = isRelatedTo((<PromisedType>source).type, (<PromisedType>target).type, /*reportErrors*/ false)) {
9233
- return result;
9234
- }
9235
- }
9236
- // A type S is related to promised T if S is related to promised C, where C is the
9237
- // constraint of T.
9238
- const constraint = getConstraintOfType((<PromisedType>target).type);
9239
- if (constraint) {
9240
- if (result = isRelatedTo(source, getPromisedType(constraint), reportErrors)) {
9241
- return result;
9242
- }
9229
+ else if (target.flags & TypeFlags.Promised && source.flags & TypeFlags.Promised) {
9230
+ // A promised S is related to a promised T if S is related to T:
9231
+ //
9232
+ // S <: T ⇒ promised S <: promised T
9233
+ //
9234
+ if (result = isRelatedTo((<PromisedType>source).type, (<PromisedType>target).type, reportErrors)) {
9235
+ return result;
9243
9236
}
9244
9237
}
9245
9238
@@ -9291,7 +9284,10 @@ namespace ts {
9291
9284
}
9292
9285
else if (source.flags & TypeFlags.Promised) {
9293
9286
// A promised S is related to T if promised C is related to T, where C is the
9294
- // constraint of S.
9287
+ // constraint of S:
9288
+ //
9289
+ // S <: C ^ promised C <: T ⇒ promised S <: T
9290
+ //
9295
9291
const constraint = getConstraintOfType((<PromisedType>source).type);
9296
9292
if (constraint) {
9297
9293
if (result = isRelatedTo(getPromisedType(constraint), target, reportErrors)) {
You can’t perform that action at this time.
0 commit comments