Skip to content

Better error messages for missing type of recursive definitions #2026

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

Merged
merged 2 commits into from
Feb 24, 2017

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Feb 23, 2017

Fixes #2001.

@ennru Do you want to review this one?

Btw, thanks for all the good work on error messages!

Copy link
Contributor

@ennru ennru left a comment

Choose a reason for hiding this comment

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

My pleasure.
I'd like to see @tailrec on errorMsg.
Indentation of the part after your changes suggests the if (cycleSym.is(Implicit, is part of the errorMsg method.
For error reporting with explanation, we'd like to return Message instead of String, but I can fix that once you merged your change.

@odersky
Copy link
Contributor Author

odersky commented Feb 23, 2017

Fixed the indentation. Regarding @tailrec, I think it's better to leave it out, even though the method happens to be tail recursive. But it is neither performance sensitive nor likely to traverse very deeply, so there's no need to require tail recursion here.

@odersky odersky merged commit db24246 into scala:master Feb 24, 2017
@ennru
Copy link
Contributor

ennru commented Mar 3, 2017

@odersky I'm converting the error messages for recursive things to the case class scheme and want to add a unit test for "cyclic reference involving implicit". Can you help me to come up with a smallish example?

@odersky
Copy link
Contributor Author

odersky commented Mar 4, 2017

Hi Enno, there's one in neg/implicitDefs.

@allanrenucci allanrenucci deleted the fix-#2001 branch December 14, 2017 19:18
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

Successfully merging this pull request may close these issues.

2 participants