From b61eaf70a1587ad0d171ec3141ad90fe1a34d764 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Mon, 15 May 2017 10:31:47 -0700 Subject: [PATCH] Inline function that is called once --- src/compiler/checker.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 6c68df7c0c1..9e6a5f946b3 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -9598,10 +9598,6 @@ namespace ts { return signature.hasRestParameter && parameterIndex >= signature.parameters.length - 1; } - function areAllParametersOptionalAfter(signature: Signature, parameterIndex: number) { - return parameterIndex >= signature.minArgumentCount; - } - function isSupertypeOfEach(candidate: Type, types: Type[]): boolean { for (const t of types) { if (candidate !== t && !isTypeSubtypeOf(t, candidate)) return false; @@ -14653,7 +14649,7 @@ namespace ts { // If spread arguments are present, check that they correspond to a rest parameter. If so, no // further checking is necessary. if (spreadArgIndex >= 0) { - return isRestParameterIndex(signature, spreadArgIndex) || areAllParametersOptionalAfter(signature, spreadArgIndex); + return isRestParameterIndex(signature, spreadArgIndex) || spreadArgIndex >= signature.minArgumentCount; } // Too many arguments implies incorrect arity.