File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16281,18 +16281,10 @@ namespace ts {
1628116281 }
1628216282 }
1628316283
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-
1629316284 function checkNonThenableType(type: Type, location?: Node, message?: DiagnosticMessage): Type {
1629416285 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())) {
1629616288 if (location) {
1629716289 if (!message) {
1629816290 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