Ref unwrapping causes generic type inference to fail #1930
Labels
🍰 p2-nice-to-have
Priority 2: this is not breaking anything but nice to have it addressed.
scope: types
✨ feature request
New feature or request
Version
3.0.0-rc.7
Reproduction link
https://codesandbox.io/s/stupefied-beaver-500yq?file=/src/test.ts:0-404
Steps to reproduce
Write the following, reasonably minimal code.
What is expected?
That the types are inferred correctly.
What is actually happening?
In the
Bar
case, Typescript complains aboutType 'ComputedRef<number>' is not assignable to type 'number'
. In the Foo case, everything works as expected.This might as well be a bug with Typescript, but considering that it affects Vue's reactive API due to the automatic ref unwrapping, I thought I'd open it here first.
The text was updated successfully, but these errors were encountered: