[isTypeReadonly] Intersections involving a readonly array fail #4428
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
bug
Something isn't working
package: type-utils
Issues related to the @typescript-eslint/type-utils package
Repro
Expected Result
isTypeReadonly
should returntrue
Actual Result
isTypeReadonly
returnsfalse
Additional Info
The error seems to be that TypeScript treats
Readonly<ReadonlyArray<string>>
the same asReadonlyArray<string>
and thus the methods are still mutable. We need a special case to handle intersections with readonly arrays.Versions
@typescript-eslint/type-utils
5.9.0
TypeScript
4.5.4
node
17.1.0
The text was updated successfully, but these errors were encountered: