Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Conversation

@bamarsha
Copy link
Contributor

Resolves #1087.

This is a bit subtle... Basically, when resolving a type parameter, the original code preferred the range of the type that the type parameter pointed to. This is not correct for the example in #1087, because that type range comes from the previous line that declared the variable carry.

In this PR, it now prefers the range of the original type before resolution, whose range corresponds to the reference to carry on the line with the call to Message.

Since there are no tests for diagnostic ranges, it's hard to say if this won't break any other diagnostics, but I can't think of any examples where this is incorrect...

@bamarsha bamarsha merged commit 6d20b62 into main Aug 3, 2021
@bamarsha bamarsha deleted the samarsha/fix-diagnostic-range branch August 3, 2021 20:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Type checking diagnostic is in the wrong location

3 participants