Skip to content

Commit c9f6bc6

Browse files
committed
Test coupling of type parameters
1 parent e08dce2 commit c9f6bc6

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

src/harness/unittests/extractMethods.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,11 @@ namespace A {
600600
M<T1, T2>(t1: T1, t2: T2) {
601601
[#|t1.toString()|];
602602
}
603+
}`);
604+
// Coupled constraints
605+
testExtractMethod("extractMethod19",
606+
`function F<T, U extends T[], V extends U[]>(v: V) {
607+
[#|v.toString()|];
603608
}`);
604609
});
605610

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// ==ORIGINAL==
2+
function F<T, U extends T[], V extends U[]>(v: V) {
3+
v.toString();
4+
}
5+
// ==SCOPE::function 'F'==
6+
function F<T, U extends T[], V extends U[]>(v: V) {
7+
newFunction();
8+
9+
function newFunction() {
10+
v.toString();
11+
}
12+
}
13+
// ==SCOPE::global scope==
14+
function F<T, U extends T[], V extends U[]>(v: V) {
15+
newFunction<T, U, V>(v);
16+
}
17+
function newFunction<T, U extends T[], V extends U[]>(v: V) {
18+
v.toString();
19+
}

0 commit comments

Comments
 (0)