Skip to content

Commit a236461

Browse files
Reversed order of checks, since the implementation will typically be more general than the overload.
1 parent e012645 commit a236461

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/compiler/checker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4988,8 +4988,8 @@ namespace ts {
49884988
const sourceReturnType = getReturnTypeOfSignature(erasedSource);
49894989
const targetReturnType = getReturnTypeOfSignature(erasedTarget);
49904990
if (targetReturnType === voidType
4991-
|| checkTypeRelatedTo(sourceReturnType, targetReturnType, assignableRelation, /*errorNode*/ undefined)
4992-
|| checkTypeRelatedTo(targetReturnType, sourceReturnType, assignableRelation, /*errorNode*/ undefined)) {
4991+
|| checkTypeRelatedTo(targetReturnType, sourceReturnType, assignableRelation, /*errorNode*/ undefined)
4992+
|| checkTypeRelatedTo(sourceReturnType, targetReturnType, assignableRelation, /*errorNode*/ undefined)) {
49934993
const anyReturningSource = cloneSignature(erasedSource);
49944994
const anyReturningTarget = cloneSignature(erasedTarget);
49954995
anyReturningSource.resolvedReturnType = anyType;

0 commit comments

Comments
 (0)