Sfoglia il codice sorgente

test(types): test dts for Options API method return type inference (#1708)

Carlos Rodrigues 5 anni fa
parent
commit
5681fdb211
1 ha cambiato i file con 5 aggiunte e 0 eliminazioni
  1. 5 0
      test-dts/defineComponent.test-d.tsx

+ 5 - 0
test-dts/defineComponent.test-d.tsx

@@ -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)
     }
   })
 })