You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{InjectionKey,provide,ref,Ref}from'vue';typeCube={size: number;};constinjectionKeyRef=Symbol('key')asInjectionKey<Ref<Cube>>;// no type errorprovide(injectionKeyRef,ref({}));
What is expected?
When using provide, I expect a type error when assigning Ref<{}> to Ref<Cube>, the same way that {} isn't assignable to Cube.
What is actually happening?
Ref<{}> is assignable to Ref<Cube> when using provide
Vue version
3.2.47
Link to minimal reproduction
https://stackblitz.com/edit/vitejs-vite-nyan1h?file=src/main.ts
Steps to reproduce
Ref<someObject>
Ref<{}>
What is expected?
When using
provide
, I expect a type error when assigningRef<{}>
toRef<Cube>
, the same way that{}
isn't assignable toCube
.What is actually happening?
Ref<{}>
is assignable toRef<Cube>
when usingprovide
System Info
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: