Skip to content
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

Enable -Xlog-implicits by default for whitebox macro exceptions #72

Open
wants to merge 1 commit into
base: 2.12.x
Choose a base branch
from

Conversation

retronym
Copy link
Owner

scala> import reflect.macros._, language.experimental.macros; class C1; implicit def c1: C1 = macro c1Impl; def c1Impl(c: whitebox.Context) = {import c.universe._; throw null}
import reflect.macros._
import language.experimental.macros
defined class C1
defined term macro c1: C1
c1Impl: (c: scala.reflect.macros.whitebox.Context)Nothing

scala> implicitly[C1]
<console>:18: c1 is not a valid implicit value for C1 because:
exception typechecking implicit candidate (a whitebox macro): exception during macro expansion:
java.lang.NullPointerException
	at .c1Impl(<console>:11)

       implicitly[C1]
                 ^
<console>:18: this.<c1: error> is not a valid implicit value for C1 because:
exception typechecking implicit candidate (a whitebox macro): exception during macro expansion:
java.lang.NullPointerException
	at .c1Impl(<console>:11)

       implicitly[C1]
                 ^
<console>:18: error: could not find implicit value for parameter e: C1
       implicitly[C1]
                 ^

scala> :quit

```
scala> import reflect.macros._, language.experimental.macros; class C1; implicit def c1: C1 = macro c1Impl; def c1Impl(c: whitebox.Context) = {import c.universe._; throw null}
import reflect.macros._
import language.experimental.macros
defined class C1
defined term macro c1: C1
c1Impl: (c: scala.reflect.macros.whitebox.Context)Nothing

scala> implicitly[C1]
<console>:18: c1 is not a valid implicit value for C1 because:
exception typechecking implicit candidate (a whitebox macro): exception during macro expansion:
java.lang.NullPointerException
	at .c1Impl(<console>:11)

       implicitly[C1]
                 ^
<console>:18: this.<c1: error> is not a valid implicit value for C1 because:
exception typechecking implicit candidate (a whitebox macro): exception during macro expansion:
java.lang.NullPointerException
	at .c1Impl(<console>:11)

       implicitly[C1]
                 ^
<console>:18: error: could not find implicit value for parameter e: C1
       implicitly[C1]
                 ^

scala> :quit
```
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.

1 participant