Skip to content

Incorrect error for bad argument of a DOM type #27049

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sandersn opened this issue Sep 12, 2018 · 3 comments
Closed

Incorrect error for bad argument of a DOM type #27049

sandersn opened this issue Sep 12, 2018 · 3 comments

Comments

@sandersn
Copy link
Member

declare var ohno: new () => Node;
declare function ff(t: Node): void;
ff(ohno)

Expected behavior:
Error: "Argument of type 'new () => Node' is not assignable to parameter of type 'Node'

Actual behavior:
Type 'new () => Node' is not assignable to type 'Node'.

Only seems to repro when both the source and target types are in the DOM.

@sandersn
Copy link
Member Author

Could be caused by #27016 or #27013?

@DanielRosenwasser
Copy link
Member

Probably the latter - it'd be great if these baselines included related error spans.

@weswigham
Copy link
Member

Yeah, definitely the latter. As is, an elaboration overrides the default error message, even if the elaboration occurs right at the top level. It's fixable, if we'd like to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants