From c9f6bc60e2f345c59653aa40221cad8ca6f0a1dd Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Thu, 17 Aug 2017 15:14:36 -0700 Subject: [PATCH] Test coupling of type parameters --- src/harness/unittests/extractMethods.ts | 5 +++++ .../extractMethod/extractMethod19.ts | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 tests/baselines/reference/extractMethod/extractMethod19.ts diff --git a/src/harness/unittests/extractMethods.ts b/src/harness/unittests/extractMethods.ts index 227f6b22b03..a7741a56f59 100644 --- a/src/harness/unittests/extractMethods.ts +++ b/src/harness/unittests/extractMethods.ts @@ -600,6 +600,11 @@ namespace A { M(t1: T1, t2: T2) { [#|t1.toString()|]; } +}`); + // Coupled constraints + testExtractMethod("extractMethod19", + `function F(v: V) { + [#|v.toString()|]; }`); }); diff --git a/tests/baselines/reference/extractMethod/extractMethod19.ts b/tests/baselines/reference/extractMethod/extractMethod19.ts new file mode 100644 index 00000000000..1bf25550172 --- /dev/null +++ b/tests/baselines/reference/extractMethod/extractMethod19.ts @@ -0,0 +1,19 @@ +// ==ORIGINAL== +function F(v: V) { + v.toString(); +} +// ==SCOPE::function 'F'== +function F(v: V) { + newFunction(); + + function newFunction() { + v.toString(); + } +} +// ==SCOPE::global scope== +function F(v: V) { + newFunction(v); +} +function newFunction(v: V) { + v.toString(); +}