Skip to content

Crash while running quote inside macro #4456

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

Closed
nicolasstucki opened this issue May 4, 2018 · 0 comments
Closed

Crash while running quote inside macro #4456

nicolasstucki opened this issue May 4, 2018 · 0 comments

Comments

@nicolasstucki
Copy link
Contributor

nicolasstucki commented May 4, 2018

import scala.quoted._
import dotty.tools.dotc.quoted.Toolbox._
object Macros {
  inline def foo(i: Int): Int = ~{
    val y = ('(i)).run
    y.toExpr
  }
}
import Macros._
object Test {
  def main(args: Array[String]): Unit = {
    println(foo(1))
    println(foo(1  + 3)) // Crashes the compiler
  }
}
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue May 4, 2018
@nicolasstucki nicolasstucki self-assigned this May 8, 2018
nicolasstucki added a commit that referenced this issue May 13, 2018
Fix #4456: Pickle quote before compiling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant