TypeScript - properties with getters & setters are detected incorrectly as read-only, when generics and union type used

I found a bug regarding slightly more complex union types. When there is (A) a generic class with getter/setter and (B) class extending the (A), the union of these two classes will be detected by WebStorm as it would have only getter.

It doesn't matter if generic type is used as part of that property.

It works fine in any other case:

  • When only single type is used
  • When there are no generics involved

I tested it directly with TypeScript, and TS itself is not reporting that error, so it's rather purely WebStorm's issue.

1 comment
Comment actions Permalink

Thanks for reporting, submitted to developers as https://youtrack.jetbrains.com/issue/WEB-52628; please vote for it to be notified when it's fixed

1

Please sign in to leave a comment.