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

Breaks macros with higher-kinded implicits #15

Open
steinybot opened this issue Apr 24, 2023 · 0 comments
Open

Breaks macros with higher-kinded implicits #15

steinybot opened this issue Apr 24, 2023 · 0 comments

Comments

@steinybot
Copy link

steinybot commented Apr 24, 2023

When context-applied is enabled it breaks the following:

import scala.language.experimental.macros
import scala.reflect.macros.blackbox

trait F[A]

object MacroImpl {

  def myMacroImpl(c: blackbox.Context)()(bob: c.Expr[F[_]]): c.Expr[Unit] = {
    import c.universe._
    c.Expr[Unit](q"""()""")
  }
}

object Macro {

  def myMacro[B]()(implicit bob: F[B]): Unit = macro MacroImpl.myMacroImpl
}

It fails to compile with:

[error] /Users/jason/src/bug-reports/src/main/scala/Macro.scala:16:64: missing argument list for method myMacroImpl in object MacroImpl
[error] Unapplied methods are only converted to functions when a function type is expected.
[error] You can make this conversion explicit by writing `myMacroImpl _` or `myMacroImpl(_)()(_)` instead of `myMacroImpl`.
[error]   def myMacro[B]()(implicit bob: F[B]): Unit = macro MacroImpl.myMacroImpl
[error]                                                                ^
[error] one error found

👉 Reproduction

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

No branches or pull requests

1 participant