Skip to content

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