fix(types): improve type of unref()

fix #3954
This commit is contained in:
Evan You
2021-07-01 15:20:49 -04:00
parent 69b74a806f
commit 127ed1b969
2 changed files with 8 additions and 1 deletions

View File

@@ -203,3 +203,10 @@ switch (data.state.value) {
data.state.value = 'state1'
break
}
// #3954
function testUnrefGenerics<T>(p: T | Ref<T>) {
expectType<T>(unref(p))
}
testUnrefGenerics(1)