From cb1bb19358fbc0d6e85e6915b3c3e4de59ce1fa2 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Mon, 14 Nov 2016 15:26:33 -0800 Subject: [PATCH] Update comment --- src/compiler/checker.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 89ed65805d8..396715bfa45 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -17257,10 +17257,10 @@ namespace ts { function checkElementTypeOfArrayOrString(arrayOrStringType: Type, errorNode: Node): Type { Debug.assert(languageVersion < ScriptTarget.ES2015); - // After we remove all types that are StringLike, we will know if there was a string constituent - // based on whether the remaining type is the same as the initial type. let arrayType = arrayOrStringType; if (arrayOrStringType.flags & TypeFlags.Union) { + // After we remove all types that are StringLike, we will know if there was a string constituent + // based on whether the result of filter is a new array. const arrayTypes = (arrayOrStringType as UnionType).types; const filteredTypes = filter(arrayTypes, t => !(t.flags & TypeFlags.StringLike)); if (filteredTypes !== arrayTypes) {