Skip to content

An NPE in TypeTree.setOriginal #7284

Closed
Closed
@scabug

Description

@scabug
import scala.language.experimental.macros
import scala.reflect.macros.Macro

object TypeOf {
  type TypeOf[T](s: T) = macro TypeOfMacro.TypeOf[T]
}
trait TypeOfMacro extends Macro {
  import c.universe._

  def TypeOf[T: WeakTypeTag](s: Expr[T]): Tree = {
    c.echo(NoPosition, "T " + weakTypeOf[T])
    tq"${weakTypeOf[T]}"
  }
}
import TypeOf._

trait A {
  val i: Int
  val j: TypeOf(i)
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions