Test coupling of type parameters

This commit is contained in:
Andrew Casey
2017-08-29 11:24:07 -07:00
parent e08dce2c21
commit c9f6bc60e2
2 changed files with 24 additions and 0 deletions
+5
View File
@@ -600,6 +600,11 @@ namespace A {
M<T1, T2>(t1: T1, t2: T2) {
[#|t1.toString()|];
}
}`);
// Coupled constraints
testExtractMethod("extractMethod19",
`function F<T, U extends T[], V extends U[]>(v: V) {
[#|v.toString()|];
}`);
});
@@ -0,0 +1,19 @@
// ==ORIGINAL==
function F<T, U extends T[], V extends U[]>(v: V) {
v.toString();
}
// ==SCOPE::function 'F'==
function F<T, U extends T[], V extends U[]>(v: V) {
newFunction();
function newFunction() {
v.toString();
}
}
// ==SCOPE::global scope==
function F<T, U extends T[], V extends U[]>(v: V) {
newFunction<T, U, V>(v);
}
function newFunction<T, U extends T[], V extends U[]>(v: V) {
v.toString();
}