Microsoft/TypeScript
Ver no GitHubServices for non-homomorphic mapped type
Open
#25.607 aberto em 12 de jul. de 2018
Domain: LS: Symbol NavigationDomain: Mapped TypesExperience EnhancementHelp WantedSuggestion
Métricas do repositório
- Stars
- (48.455 stars)
- Métricas de merge de PR
- (Mesclagem média 6d 17h) (9 fundiu PRs em 30d)
Description
TypeScript Version: 3.0.0-dev.20180712
Code
interface I {
a: number;
b: number;
}
type J = { [K in "b"]: I[K] };
declare const j: J;
j.b; // Go-to-definition does not work
Expected behavior:
Since the type we're getting is I[K], the mapped property symbol should have a reference back to the corresponding property in I.
Actual behavior:
The mapped type creates an unrelated property symbol and services don't work.