Set wrapped with Ref Ractive, there will be type problems with the has add ... method.
Vue version
3.3.10
Link to minimal reproduction
Steps to reproduce
- code
- log
What is expected?
No type errors.
What is actually happening?
It should be caused by this commit: https://github.com/vuejs/core/pull/8960 This commit resolves the issue with ref (it should behave as expected when accessed), but it does not work correctly in the has method of Set.
System Info
No response
Any additional comments?
No response
This is expected, we either have unwrapped or the original types on collections, to better reflect the code at runtime the #8960 is correct.
for (const c of a.value) {
console.log('ref has', a.value.has(ref(o).value), a.value.has(ref(c).value));
}
for (const c of b) {
console.log('reactive has', b.has(ref(o).value), b.has(ref(c).value));
}
if you wrap them into ref
they will still log true true
.
I don't think this issue should be fixed ATM and should wait for https://github.com/microsoft/TypeScript/issues/43826 to do a revamp on get/set