1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
// ==ORIGINAL==
class C<T1, T2> {
M(t1: T1, t2: T2) {
/*[#|*/t1.toString()/*|]*/;
}
}
// ==SCOPE::Extract to inner function in method 'M'==
class C<T1, T2> {
M(t1: T1, t2: T2) {
/*RENAME*/newFunction();
function newFunction() {
t1.toString();
}
}
}
// ==SCOPE::Extract to method in class 'C'==
class C<T1, T2> {
M(t1: T1, t2: T2) {
this./*RENAME*/newMethod(t1);
}
private newMethod(t1: T1) {
t1.toString();
}
}
// ==SCOPE::Extract to function in global scope==
class C<T1, T2> {
M(t1: T1, t2: T2) {
/*RENAME*/newFunction<T1>(t1);
}
}
function newFunction<T1>(t1: T1) {
t1.toString();
}
|