Skip to content
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

No related error spans return for type assignment mismatch #26145

Open
mjbvz opened this issue Aug 2, 2018 · 2 comments
Open

No related error spans return for type assignment mismatch #26145

mjbvz opened this issue Aug 2, 2018 · 2 comments
Labels
Domain: Related Error Spans Specifying regions for error messages/diagnostics on multiple locations. Experience Enhancement Noncontroversial enhancements Suggestion An idea for TypeScript
Milestone

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Aug 2, 2018

TypeScript Version: 3.1.0-dev.20180802

Search Terms:

  • relatedInformation
  • related diagnostics

Code
For the ts:

let b: number = 1
b = ''

Expected behavior:
relatedInformation is returned on the assignment of b = '' (#25030)

Actual behavior:
No relatedInformation

Playground Link:

Related Issues:

@mhegazy
Copy link
Contributor

mhegazy commented Aug 2, 2018

it is expected to be on the properties. e.g.:

type SomeType = { a: number; b: string };

var x: SomeType = {
    a: "",
    b: ""
}

@mhegazy mhegazy added Working as Intended The behavior described is the intended behavior; this is not a bug Suggestion An idea for TypeScript and removed Working as Intended The behavior described is the intended behavior; this is not a bug labels Aug 2, 2018
@mhegazy
Copy link
Contributor

mhegazy commented Aug 2, 2018

I suppose we can look at the error node and deduce it is an assignment, then put the related span with the declaration as well.

@mhegazy mhegazy added the Domain: Related Error Spans Specifying regions for error messages/diagnostics on multiple locations. label Aug 2, 2018
@RyanCavanaugh RyanCavanaugh added the Experience Enhancement Noncontroversial enhancements label Aug 13, 2018
@weswigham weswigham removed the Suggestion An idea for TypeScript label Nov 6, 2018
@RyanCavanaugh RyanCavanaugh added the Suggestion An idea for TypeScript label Mar 7, 2019
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Aug 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Domain: Related Error Spans Specifying regions for error messages/diagnostics on multiple locations. Experience Enhancement Noncontroversial enhancements Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

4 participants