diff --git a/test-dts/defineComponent.test-d.tsx b/test-dts/defineComponent.test-d.tsx index 29194ca3912..dcbad6a0fad 100644 --- a/test-dts/defineComponent.test-d.tsx +++ b/test-dts/defineComponent.test-d.tsx @@ -269,6 +269,19 @@ describe('type inference w/ options API', () => { d(): number { expectType(this.b) return this.b + 1 + }, + e: { + get(): number { + expectType(this.b) + expectType(this.d) + + return this.b + this.d + }, + set(v: number) { + expectType(this.b) + expectType(this.d) + expectType(v) + } } }, watch: { @@ -286,6 +299,8 @@ describe('type inference w/ options API', () => { expectType(this.c) // computed expectType(this.d) + // computed get/set + expectType(this.e) }, methods: { doSomething() { @@ -297,6 +312,8 @@ describe('type inference w/ options API', () => { expectType(this.c) // computed expectType(this.d) + // computed get/set + expectType(this.e) }, returnSomething() { return this.a @@ -311,6 +328,8 @@ describe('type inference w/ options API', () => { expectType(this.c) // computed expectType(this.d) + // computed get/set + expectType(this.e) // method expectType<() => number | undefined>(this.returnSomething) }