@@ -386,10 +386,10 @@ module ts {
386
386
387
387
function declareSymbolAndAddToSymbolTableWorker ( node : Declaration , symbolFlags : SymbolFlags , symbolExcludes : SymbolFlags ) : Symbol {
388
388
switch ( container . kind ) {
389
- // Modules, source files, and classes need specialized handling for how their
389
+ // Modules, source files, and classes need specialized handling for how their
390
390
// members are declared (for example, a member of a class will go into a specific
391
- // symbol table depending on if it is static or not). As such, we defer to
392
- // specialized handlers to take care of declaring these child members.
391
+ // symbol table depending on if it is static or not). We defer to specialized
392
+ // handlers to take care of declaring these child members.
393
393
case SyntaxKind . ModuleDeclaration :
394
394
return declareModuleMember ( node , symbolFlags , symbolExcludes ) ;
395
395
@@ -407,9 +407,10 @@ module ts {
407
407
case SyntaxKind . ObjectLiteralExpression :
408
408
case SyntaxKind . InterfaceDeclaration :
409
409
// Interface/Object-types always have their children added to the 'members' of
410
- // their container. They are only accessible through an instance of their
411
- // container, and are never in scope otherwise (even inside the body of the
412
- // object / type / interface declaring them).
410
+ // their container. They are only accessible through an instance of their
411
+ // container, and are never in scope otherwise (even inside the body of the
412
+ // object / type / interface declaring them). An exception is type parameters,
413
+ // which are in scope without qualification (similar to 'locals').
413
414
return declareSymbol ( container . symbol . members , container . symbol , node , symbolFlags , symbolExcludes ) ;
414
415
415
416
case SyntaxKind . FunctionType :
@@ -427,10 +428,10 @@ module ts {
427
428
case SyntaxKind . ArrowFunction :
428
429
case SyntaxKind . TypeAliasDeclaration :
429
430
// All the children of these container types are never visible through another
430
- // symbol (i.e. through another symbol's 'exports' or 'members'). Instead,
431
- // they're only accessed 'lexically' (i.e. from code that exists underneath
431
+ // symbol (i.e. through another symbol's 'exports' or 'members'). Instead,
432
+ // they're only accessed 'lexically' (i.e. from code that exists underneath
432
433
// their container in the tree. To accomplish this, we simply add their declared
433
- // symbol to the 'locals' of the container. These symbols can then be found as
434
+ // symbol to the 'locals' of the container. These symbols can then be found as
434
435
// the type checker walks up the containers, checking them for matching names.
435
436
return declareSymbol ( container . locals , undefined , node , symbolFlags , symbolExcludes ) ;
436
437
}
0 commit comments