- Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
TypeScript Version: master
Code
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'.
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue