File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -17257,10 +17257,10 @@ namespace ts {
17257
17257
function checkElementTypeOfArrayOrString(arrayOrStringType: Type, errorNode: Node): Type {
17258
17258
Debug.assert(languageVersion < ScriptTarget.ES2015);
17259
17259
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.
17262
17260
let arrayType = arrayOrStringType;
17263
17261
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.
17264
17264
const arrayTypes = (arrayOrStringType as UnionType).types;
17265
17265
const filteredTypes = filter(arrayTypes, t => !(t.flags & TypeFlags.StringLike));
17266
17266
if (filteredTypes !== arrayTypes) {
You can’t perform that action at this time.
0 commit comments