ToRefs doesn't respect readonly properties, UnwrapNestedRefs doesn't respect ComputedRef
Version
3.2.26
Reproduction link
Steps to reproduce
const shouldHaveComputedRef = toRefs(readonly(reactive({ foo: 'foo' })))
// runtime warning, no TS error
shouldHaveComputedRef.foo = 'bar'
const shouldHaveReadonly = reactive({ foo: computed(() => 'foo') })
// runtime warning, no TS error
shouldHaveReadonly.foo = 'bar'
What is expected?
toRefs
/reactive
return types should include correct readonly/ComputedRef types.
What is actually happening?
toRefs
/reactive
return types always result in settable property types, even though attempting to set them produces a warning and fails