Open
Description
Vue version
3.5.13
Link to minimal reproduction
Steps to reproduce
Just observe TS errors on lines 6 and 12 of repro
Basically, toRef(MaybeRef<number>).value
has this type Ref<T = any, S = T>.value: S = T
instead of roughly number
What is expected?
No TS errors
What is actually happening?
TS errors:
Type 'number' is not assignable to type 'S'.
'S' could be instantiated with an arbitrary type which could be unrelated to 'number'.ts(2322)
System Info
System:
OS: Linux 5.15 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish)
CPU: (20) x64 12th Gen Intel(R) Core(TM) i9-12900H
Memory: 26.21 GB / 31.19 GB
Container: Yes
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 20.17.0 - ~/.nvm/versions/node/v20.17.0/bin/node
npm: 10.8.2 - ~/.nvm/versions/node/v20.17.0/bin/npm
pnpm: 9.4.0 - ~/.local/share/pnpm/pnpm
Browsers:
Chrome: 131.0.6778.264
npmPackages:
vue: ^3.5.13 => 3.5.13
Any additional comments?
The issue seems to be resolved in TypeScript Version 5.4.0-beta and later.