Reversed order of checks, since the implementation will typically be more general than the overload.

This commit is contained in:
Daniel Rosenwasser 2015-12-11 15:10:50 -08:00
parent e012645309
commit a236461358

View file

@ -4988,8 +4988,8 @@ namespace ts {
const sourceReturnType = getReturnTypeOfSignature(erasedSource);
const targetReturnType = getReturnTypeOfSignature(erasedTarget);
if (targetReturnType === voidType
|| checkTypeRelatedTo(sourceReturnType, targetReturnType, assignableRelation, /*errorNode*/ undefined)
|| checkTypeRelatedTo(targetReturnType, sourceReturnType, assignableRelation, /*errorNode*/ undefined)) {
|| checkTypeRelatedTo(targetReturnType, sourceReturnType, assignableRelation, /*errorNode*/ undefined)
|| checkTypeRelatedTo(sourceReturnType, targetReturnType, assignableRelation, /*errorNode*/ undefined)) {
const anyReturningSource = cloneSignature(erasedSource);
const anyReturningTarget = cloneSignature(erasedTarget);
anyReturningSource.resolvedReturnType = anyType;