-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #9801: Make sure the errors are reported #9813
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
Conversation
@@ -0,0 +1 @@ | |||
def test: Unit = loop(4) // error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now, this reports correctly the NPE
-- Error: tests/pos-macros/i9801/Test_2.scala:1:21 ---------------------------------------------------------------------
1 |def test: Unit = loop(4)
| ^^^^^^^
| Exception occurred while executing macro expansion.
| java.lang.NullPointerException
| at dotty.tools.dotc.reporting.Message.dropNonSensical(Message.scala:65)
| at dotty.tools.dotc.reporting.Message.message(Message.scala:78)
| at dotty.tools.dotc.reporting.Message.isNonSensical(Message.scala:90)
| at dotty.tools.dotc.reporting.HideNonSensicalMessages.isHidden(HideNonSensicalMessages.scala:16)
| at dotty.tools.dotc.reporting.HideNonSensicalMessages.isHidden$(HideNonSensicalMessages.scala:10)
| at dotty.tools.dotc.reporting.TestReporter.isHidden(TestReporter.scala:18)
| at dotty.tools.dotc.reporting.Reporter.report(Reporter.scala:148)
| at dotty.tools.dotc.report$.error(report.scala:71)
| at dotty.tools.dotc.quoted.reflect.ReflectionCompilerInterface.error(ReflectionCompilerInterface.scala:90)
| at dotty.tools.dotc.quoted.QuoteContextImpl$$anon$1.error(QuoteContextImpl.scala:42)
| at Macro_1$package$.impl(Macro_1.scala:18)
|
| This location contains code that was inlined from Test_2.scala:2
inlined at Test_2.scala:1:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notice that in this particular case the user passed a null
into the reporting which made the reporting itself fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean e.getMessage
returns null
?
6993e32
to
24a187e
Compare
24a187e
to
ccf6c2a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -0,0 +1 @@ | |||
def test: Unit = loop(4) // error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean e.getMessage
returns null
?
No description provided.