-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Compiler hang forever when arbitrary type in arrow closure #8746
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
Comments
You should be using |
Minimized to import scala.quoted._
object Macro {
inline def mac(): String = ${ macImpl() }
def macImpl()(using qctx: QuoteContext): Expr[String] =
'{(x: String) => "anything"} match
case '{ (in: String) => ($out: $tpe2) } => Expr(out.toString)
case _ => ???
}
import scala.quoted._
object Macro {
inline def mac(): String = ${ macImpl() }
def macImpl()(using qctx: QuoteContext): Expr[String] =
'{(x: String) => "anything"} match
case '{ (in: String) => ($out: $tpe2) } => Expr(out.toString)
case _ => ???
} import Macro._
@main def testOtherstuff() = { // hello
mac()
}
|
Some side notes to improve the code
|
Fix #8746: Fix quote matcher block normalization
@nicolasstucki Like I mentioned before, we really, really, need to use |
Minimized code
When attempting a quoted match an arrow closure with arbitrary types in a macro:
E.g. when matching the following expression:
The compiler hangs forever. It does not seem to be doing anything.
Expectation
The expression should match and compile property.
Code Sample
Code sample is available here:
https://github.com/deusaquilus/arrow_forever_bug
The text was updated successfully, but these errors were encountered: