From 9b507b7512290b28bcd710a363f7a98be261a077 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 11 Dec 2015 15:08:30 -0800 Subject: [PATCH] Specifically test for 'void' to permit implementations to return more than what was guaranteed. --- src/compiler/checker.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ac8a4ac89a4..a83c1027ad1 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4987,7 +4987,8 @@ namespace ts { const sourceReturnType = getReturnTypeOfSignature(erasedSource); const targetReturnType = getReturnTypeOfSignature(erasedTarget); - if (checkTypeRelatedTo(sourceReturnType, targetReturnType, assignableRelation, /*errorNode*/ undefined) + if (targetReturnType === voidType + || checkTypeRelatedTo(sourceReturnType, targetReturnType, assignableRelation, /*errorNode*/ undefined) || checkTypeRelatedTo(targetReturnType, sourceReturnType, assignableRelation, /*errorNode*/ undefined)) { const anyReturningSource = cloneSignature(erasedSource); const anyReturningTarget = cloneSignature(erasedTarget);