mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Test coupling of type parameters
This commit is contained in:
@@ -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();
|
||||
}
|
||||
Reference in New Issue
Block a user