Skip to content

Commit cb1bb19

Browse files
committed
Update comment
1 parent db4ea4a commit cb1bb19

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
@@ -17257,10 +17257,10 @@ namespace ts {
1725717257
function checkElementTypeOfArrayOrString(arrayOrStringType: Type, errorNode: Node): Type {
1725817258
Debug.assert(languageVersion < ScriptTarget.ES2015);
1725917259

17260-
// After we remove all types that are StringLike, we will know if there was a string constituent
17261-
// based on whether the remaining type is the same as the initial type.
1726217260
let arrayType = arrayOrStringType;
1726317261
if (arrayOrStringType.flags & TypeFlags.Union) {
17262+
// After we remove all types that are StringLike, we will know if there was a string constituent
17263+
// based on whether the result of filter is a new array.
1726417264
const arrayTypes = (arrayOrStringType as UnionType).types;
1726517265
const filteredTypes = filter(arrayTypes, t => !(t.flags & TypeFlags.StringLike));
1726617266
if (filteredTypes !== arrayTypes) {

0 commit comments

Comments
 (0)