You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All this said, it does look like .isArray() returns false because the symbol doesn't have the name Array, but it should return it for this as well I think. Overall, it looks like the implementation of that method should be improved to be a bit more robust. I opened #1306 for that.
Regarding #1306: Would it make sense to add a distinct function isReadonlyArray() on types? Because ReadonlyArray is commonly used in many projects and it may makes sense to have a differentiation for them.
Describe the bug
Given a node of type
ReadonlyArray<...>
, the corresponding type isany
.Version: 15.1.0
To Reproduce
Expected behavior
The code above outputs
false
(forisArray()
),any
(forgetText()
) and[]
(forgetTypeArguments()
).The expected behaviour is that:
isArray()
outputstrue
. If not, how is an readonlyarray properly identified?getText()
outputsReadonlyArray<string>
getTypeArguments()
outputs an array of length 1The text was updated successfully, but these errors were encountered: