You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorrect constraint violation error using keyof with generic #12311
interfaceHTMLKind{"a": HTMLAnchorElement;"div": HTMLDivElement;"span": HTMLSpanElement;"input": HTMLInputElement;// ... dozens more ...[s: string]: HTMLElement;}// Incorrect error on the return type heredeclarefunctiongetElementsByTagName<TextendskeyofHTMLKind>(k: T): NodeListOf<HTMLKind[T]>;
Expected behavior:
No error
Actual behavior:
Type 'HTMLKind[T]' does not satisfy the constraint 'Node'.
Activity
mhegazy commentedon Nov 18, 2016
This is blocking the change to lib.d.ts to reduce symbol instantiations at the moment, see microsoft/TypeScript-DOM-lib-generator#166