Skip to content

Crash while running quote inside macro #4456

Closed
@nicolasstucki

Description

@nicolasstucki
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
  }
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions