File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -16281,18 +16281,10 @@ namespace ts {
16281
16281
}
16282
16282
}
16283
16283
16284
- function isTypeOrConstraintAnyOrNever(type: Type) {
16285
- while (type.flags & TypeFlags.TypeVariable) {
16286
- const constraint = getConstraintOfTypeVariable(<TypeVariable>type);
16287
- if (!constraint) break;
16288
- type = getWidenedType(constraint);
16289
- }
16290
- return (type.flags & (TypeFlags.Any | TypeFlags.Never)) !== 0;
16291
- }
16292
-
16293
16284
function checkNonThenableType(type: Type, location?: Node, message?: DiagnosticMessage): Type {
16294
16285
type = getWidenedType(type);
16295
- if (!isTypeOrConstraintAnyOrNever(type) && isTypeAssignableTo(type, getGlobalThenableType())) {
16286
+ const apparentType = getApparentType(type);
16287
+ if ((apparentType.flags & (TypeFlags.Any | TypeFlags.Never)) === 0 && isTypeAssignableTo(type, getGlobalThenableType())) {
16296
16288
if (location) {
16297
16289
if (!message) {
16298
16290
message = Diagnostics.Operand_for_await_does_not_have_a_valid_callable_then_member;
You can’t perform that action at this time.
0 commit comments