Skip to content

WIP: Narrow typers error positions #4511

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

Conversation

Blaisorblade
Copy link
Contributor

@Blaisorblade Blaisorblade commented May 11, 2018

Suggested by @smarter. Gotta review and fix all the testcases. Needed to unblock #4385, which right now has too much potential to hide stack overflows.

@odersky
Copy link
Contributor

odersky commented May 28, 2018

@Blaisorblade Can we get this in now please? We are blocked on a number of issues reporting stackoverflows until this in.

@@ -16,7 +16,7 @@ object ErrorReporting {
import tpd._

def errorTree(tree: untpd.Tree, msg: => Message)(implicit ctx: Context): tpd.Tree =
tree withType errorType(msg, tree.pos)
tree withType errorType(msg, tree.pos.focus)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not so sure anymore that this is a good idea, since it can lead to worse error messages

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only desired this effect for one call site: 0f2d1a3. So closing this PR.

Medium-term, I think you'd want positions inside TypeError, but that shouldn't block #4385.

Blaisorblade added a commit to dotty-staging/dotty that referenced this pull request May 29, 2018
@Blaisorblade
Copy link
Contributor Author

Closing. The blocker is in fact #4385, which I just unblocked otherwise.

Blaisorblade added a commit to dotty-staging/dotty that referenced this pull request May 29, 2018
Ensures stackoverflows aren't hidden by errors, without needing scala#4511.

Also add relevant testcase from
scala#4385 (comment); I confirmed
this fails without the position fix.
Blaisorblade added a commit to dotty-staging/dotty that referenced this pull request May 30, 2018
Ensures stackoverflows aren't hidden by errors, without needing scala#4511.

Also add relevant testcase from
scala#4385 (comment); I confirmed
this fails without the position fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants