File tree Expand file tree Collapse file tree 3 files changed +64
-0
lines changed Expand file tree Collapse file tree 3 files changed +64
-0
lines changed Original file line number Diff line number Diff line change @@ -586,6 +586,20 @@ namespace A {
586
586
testExtractMethod ( "extractMethod16" ,
587
587
`function F<T>() {
588
588
const array: T[] = [#|[]|];
589
+ }` ) ;
590
+ // Class type parameter
591
+ testExtractMethod ( "extractMethod17" ,
592
+ `class C<T1, T2> {
593
+ M(t1: T1, t2: T2) {
594
+ [#|t1.toString()|];
595
+ }
596
+ }` ) ;
597
+ // Method type parameter
598
+ testExtractMethod ( "extractMethod18" ,
599
+ `class C {
600
+ M<T1, T2>(t1: T1, t2: T2) {
601
+ [#|t1.toString()|];
602
+ }
589
603
}` ) ;
590
604
} ) ;
591
605
Original file line number Diff line number Diff line change
1
+ // ==ORIGINAL==
2
+ class C < T1 , T2 > {
3
+ M ( t1 : T1 , t2 : T2 ) {
4
+ t1 . toString ( ) ;
5
+ }
6
+ }
7
+ // ==SCOPE::class 'C'==
8
+ class C < T1 , T2 > {
9
+ M ( t1 : T1 , t2 : T2 ) {
10
+ this . newFunction ( t1 ) ;
11
+ }
12
+
13
+ private newFunction ( t1 : T1 ) {
14
+ t1 . toString ( ) ;
15
+ }
16
+ }
17
+ // ==SCOPE::global scope==
18
+ class C < T1 , T2 > {
19
+ M ( t1 : T1 , t2 : T2 ) {
20
+ newFunction < T1 > ( t1 ) ;
21
+ }
22
+ }
23
+ function newFunction < T1 > ( t1 : T1 ) {
24
+ t1 . toString ( ) ;
25
+ }
Original file line number Diff line number Diff line change
1
+ // ==ORIGINAL==
2
+ class C {
3
+ M < T1 , T2 > ( t1 : T1 , t2 : T2 ) {
4
+ t1 . toString ( ) ;
5
+ }
6
+ }
7
+ // ==SCOPE::class 'C'==
8
+ class C {
9
+ M < T1 , T2 > ( t1 : T1 , t2 : T2 ) {
10
+ this . newFunction < T1 > ( t1 ) ;
11
+ }
12
+
13
+ private newFunction < T1 > ( t1 : T1 ) {
14
+ t1 . toString ( ) ;
15
+ }
16
+ }
17
+ // ==SCOPE::global scope==
18
+ class C {
19
+ M < T1 , T2 > ( t1 : T1 , t2 : T2 ) {
20
+ newFunction < T1 > ( t1 ) ;
21
+ }
22
+ }
23
+ function newFunction < T1 > ( t1 : T1 ) {
24
+ t1 . toString ( ) ;
25
+ }
You can’t perform that action at this time.
0 commit comments