File tree Expand file tree Collapse file tree 4 files changed +51
-2
lines changed Expand file tree Collapse file tree 4 files changed +51
-2
lines changed Original file line number Diff line number Diff line change @@ -1587,7 +1587,6 @@ module ts {
15871587 case SyntaxKind . IndexSignature :
15881588 case SyntaxKind . Parameter :
15891589 case SyntaxKind . ModuleBlock :
1590- case SyntaxKind . TypeParameter :
15911590 case SyntaxKind . FunctionType :
15921591 case SyntaxKind . ConstructorType :
15931592 case SyntaxKind . TypeLiteral :
@@ -1597,7 +1596,9 @@ module ts {
15971596 case SyntaxKind . UnionType :
15981597 case SyntaxKind . ParenthesizedType :
15991598 return isDeclarationVisible ( < Declaration > node . parent ) ;
1600-
1599+
1600+ // Type parameters are always visible
1601+ case SyntaxKind . TypeParameter :
16011602 // Source file is always visible
16021603 case SyntaxKind . SourceFile :
16031604 return true ;
Original file line number Diff line number Diff line change 1+ //// [visibilityOfTypeParameters.ts]
2+
3+ export class MyClass {
4+ protected myMethod < T > ( val : T ) : T {
5+ return val ;
6+ }
7+ }
8+
9+ //// [visibilityOfTypeParameters.js]
10+ var MyClass = ( function ( ) {
11+ function MyClass ( ) {
12+ }
13+ MyClass . prototype . myMethod = function ( val ) {
14+ return val ;
15+ } ;
16+ return MyClass ;
17+ } ) ( ) ;
18+ exports . MyClass = MyClass ;
19+
20+
21+ //// [visibilityOfTypeParameters.d.ts]
22+ export declare class MyClass {
23+ protected myMethod < T > ( val : T ) : T ;
24+ }
Original file line number Diff line number Diff line change 1+ === tests/cases/compiler/visibilityOfTypeParameters.ts ===
2+
3+ export class MyClass {
4+ >MyClass : MyClass
5+
6+ protected myMethod<T>(val: T): T {
7+ >myMethod : <T>(val: T) => T
8+ >T : T
9+ >val : T
10+ >T : T
11+ >T : T
12+
13+ return val;
14+ >val : T
15+ }
16+ }
Original file line number Diff line number Diff line change 1+ // @module :commonjs
2+ //@declaration : true
3+
4+ export class MyClass {
5+ protected myMethod < T > ( val : T ) : T {
6+ return val ;
7+ }
8+ }
You can’t perform that action at this time.
0 commit comments