Skip to content

Fix missing error message #5832

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 3 commits into from
Feb 2, 2019

Conversation

liufengyun
Copy link
Contributor

This is a partial fix to #5831 . Once we have #5743, we can add a test case.

@@ -17,7 +17,8 @@ import config.Printers.cyclicErrors

class TypeError(msg: String) extends Exception(msg) {
def this() = this("")
def toMessage(implicit ctx: Context): Message = getMessage
def toMessage(implicit ctx: Context): Message = super.getMessage
override def getMessage: String = throw new Exception("Use toMessage instead for TypeError")
Copy link
Contributor

Choose a reason for hiding this comment

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

This may be annoying but at least no error messages will be empty due to this bug in the future

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, it helped find the problem in Formatting.scala. Thanks for suggesting it 👍

@nicolasstucki nicolasstucki merged commit 47c51dd into scala:master Feb 2, 2019
@nicolasstucki nicolasstucki deleted the fix-missing-message branch February 2, 2019 06:34
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