-
-
Notifications
You must be signed in to change notification settings - Fork 788
Labels
A-semanticArea - SemanticArea - Semantic
Description
Given the below code:
namespace Database {
export type Table<T> = T;
}
// 'Database' generic shadows the namespace, but namespace is used in 'Database.Table'
export function test<Database, Table extends Database.Table<Database>>(
database: Database,
table: Table
): { database: Database; table: Table } {
return { database, table };
}the top level Database symbol has no references, this is incorrect as it is refernced in the extends Database.Table
Database (id: 0): {
symbol_id: 0
span: { start: 10, end: 18 }
name: "Database"
flags: ValueModule
scope_id: 0
references: []
}
In typescript the left side of Database.Table is resolved with SymbolFlags.Namespace
When TS uses SymbolFlags.Namespace, it understands that type parameters have SymbolFlags.TypeParameter, and automatically excludes them when resolving the left side of a qualified name.
Metadata
Metadata
Assignees
Labels
A-semanticArea - SemanticArea - Semantic