mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 21:36:50 -05:00
Update comment
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user