Skip to content

TS: issues with private class properties with ref vs shallowRef for typed arraysΒ #12302

@ludwig801

Description

@ludwig801

Vue version

3.5.11

Link to minimal reproduction

https://play.vuejs.org/#eNqNU99r2zAQ/leEnlJIHcrYS+YGutCHDbaVrm9RGKpzTtTJktDJWULw/76THP9YYWnBYPu+T3ff3X068Tvnsn0NfM7zAJXTMsBCGMbyJ8Cw3Cm9YfO91DXcCo47qbX9c+e9PArOZv8lbgDcmJXPRrnpFwuvXGAIoXZMS7OlMwEFJ1RVzvrAhqSltxUTPJul36hV8E8978S+HZdaIrJmxIwBYrHZjOXX122yGMuoyHDSQzll554eoRwydDWEKaxB0jnqm92OjuTn4qv1YrJaX/UFZWLakoWjg07has0mKCtogxJZ2EHUkC+uukL93KhKRF6lj4NsR7fgUxoYHSrVNntBa2h/p7gNwQtbOaXB/3BBUVLB5ywhEUu6v6ZYKTXCtAOKHRS/WyD4eoi/4CHGBH/wgOD3NJceC9JvIbTw/c/vcKDvHqzsptbEvgA+AlpdR5Et7XNtNqR7xEtyv6R1KbN9wvtDAINdV1FoZDaJn7a2vND7IPdD9jGdE6ahMXbGoAnCITmjSH7qfHUSPrKdV3vyb/d+8NbNGQZPwvq1GxtUQfvdycAUPdixzynqZ62K8+ufBBFPWjqLx+v49iW5aP5o3w2UyiStmKdBpAs6HxzZS6fWoQj4Tuc+Ay2GXNssJq9d+WsPPq6IOqA5Zzc3vPkLvgN7ng==

Steps to reproduce

Essentially the same issue as reported here: vuejs/language-tools#4970 and was marked as upstream.

What is expected?

When using ref, if the given type is an array type of instances of a class with private properties, its type remains the same across it's usages.

What is actually happening?

When using ref with an array type, the iterable class type is unwrapped and it's private properties are lost, generating errors when that class type is expected, since they now do not match.

System Info

No response

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions