From 6bd35fb066112b287a5ec294f422a4eb8cb043c7 Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Tue, 8 Nov 2016 14:26:10 -0800 Subject: [PATCH] Fix Type Param method Tests --- ...assExtendsAbstractMethodTypeParamsInstantiateNumber.ts | 4 ++-- ...FixClassExtendsAbstractMethodTypeParamsInstantiateU.ts | 6 +++--- tests/cases/fourslash/codeFixUnImplementedInterface36.ts | 8 ++++++++ 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/tests/cases/fourslash/codeFixClassExtendsAbstractMethodTypeParamsInstantiateNumber.ts b/tests/cases/fourslash/codeFixClassExtendsAbstractMethodTypeParamsInstantiateNumber.ts index d434f282884..1faa572b5bc 100644 --- a/tests/cases/fourslash/codeFixClassExtendsAbstractMethodTypeParamsInstantiateNumber.ts +++ b/tests/cases/fourslash/codeFixClassExtendsAbstractMethodTypeParamsInstantiateNumber.ts @@ -1,13 +1,13 @@ /// //// abstract class A { -//// abstract f(x: T); +//// abstract f(x: T): T; //// } //// //// class C extends A {[| //// |]} -verify.rangeAfterCodeFix(`f(x: number){ +verify.rangeAfterCodeFix(`f(x: number): number{ throw new Error('Method not Implemented'); } `); \ No newline at end of file diff --git a/tests/cases/fourslash/codeFixClassExtendsAbstractMethodTypeParamsInstantiateU.ts b/tests/cases/fourslash/codeFixClassExtendsAbstractMethodTypeParamsInstantiateU.ts index 7d6b8e1e815..abb8b6fd2a7 100644 --- a/tests/cases/fourslash/codeFixClassExtendsAbstractMethodTypeParamsInstantiateU.ts +++ b/tests/cases/fourslash/codeFixClassExtendsAbstractMethodTypeParamsInstantiateU.ts @@ -1,13 +1,13 @@ /// //// abstract class A { -//// abstract f(x: T); +//// abstract f(x: T): T; //// } //// //// class C extends A {[| -//// |]} +//// |]} -verify.rangeAfterCodeFix(`f(x: U){ +verify.rangeAfterCodeFix(`f(x: U): U{ throw new Error('Method not Implemented'); } `); \ No newline at end of file diff --git a/tests/cases/fourslash/codeFixUnImplementedInterface36.ts b/tests/cases/fourslash/codeFixUnImplementedInterface36.ts index 17f889b56bf..6200b2ac467 100644 --- a/tests/cases/fourslash/codeFixUnImplementedInterface36.ts +++ b/tests/cases/fourslash/codeFixUnImplementedInterface36.ts @@ -14,7 +14,15 @@ //// //// |]} +verify.rangeAfterCodeFix(`f1(){ + throw new Error('Method not Implemented'); +} +`); + +// TODO: (arozga) Include type qualifiers. +/* verify.rangeAfterCodeFix(`f1(){ throw new Error('Method not Implemented'); } `); +*/