diff --git a/packages/reactivity/src/ref.ts b/packages/reactivity/src/ref.ts index 010fb8d85bd..98cb3e2f376 100644 --- a/packages/reactivity/src/ref.ts +++ b/packages/reactivity/src/ref.ts @@ -19,11 +19,6 @@ export interface Ref { * @internal */ _shallow?: boolean - - /** - * Deps are maintained locally rather than in depsMap for performance reasons. - */ - dep?: Dep } type RefBase = { diff --git a/test-dts/reactivity.test-d.ts b/test-dts/reactivity.test-d.ts index edccd4fa099..3c35ea58a01 100644 --- a/test-dts/reactivity.test-d.ts +++ b/test-dts/reactivity.test-d.ts @@ -1,9 +1,15 @@ -import { readonly, describe, expectError } from './index' - -describe('should support DeepReadonly', () => { - const r = readonly({ obj: { k: 'v' } }) - // @ts-expect-error - expectError((r.obj = {})) - // @ts-expect-error - expectError((r.obj.k = 'x')) -}) +import { ref, readonly, describe, expectError, expectType, Ref } from './index' + +describe('should support DeepReadonly', () => { + const r = readonly({ obj: { k: 'v' } }) + // @ts-expect-error + expectError((r.obj = {})) + // @ts-expect-error + expectError((r.obj.k = 'x')) +}) + +// #4180 +describe('readonly ref', () => { + const r = readonly(ref({ count: 1 })) + expectType(r) +})