]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
test(types): test dts for Options API method return type inference (#1708)
authorCarlos Rodrigues <david-181@hotmail.com>
Tue, 28 Jul 2020 19:31:23 +0000 (20:31 +0100)
committerGitHub <noreply@github.com>
Tue, 28 Jul 2020 19:31:23 +0000 (15:31 -0400)
test-dts/defineComponent.test-d.tsx

index f37c0eb1eaa9d6ac8f058c36d56942ba8d0fdab1..29194ca391299b5093ab9b82fb44bda23ba1eb4f 100644 (file)
@@ -297,6 +297,9 @@ describe('type inference w/ options API', () => {
         expectType<number>(this.c)
         // computed
         expectType<number>(this.d)
+      },
+      returnSomething() {
+        return this.a
       }
     },
     render() {
@@ -308,6 +311,8 @@ describe('type inference w/ options API', () => {
       expectType<number>(this.c)
       // computed
       expectType<number>(this.d)
+      // method
+      expectType<() => number | undefined>(this.returnSomething)
     }
   })
 })