Skip to content

"position not set" error when using scala.util.Not and inline #9972

Closed
@IndiscriminateCoding

Description

@IndiscriminateCoding

Minimized code

notmacro/Main.scala:

package notmacro

import scala.util.Not

object Main extends App {
  summon[Not[T[Int]]]
}

notmacro/T.scala:

package notmacro

import scala.quoted._

case class T[A <: AnyKind](s: String)

object T {
  implicit inline def derived[A <: AnyKind]: T[A] = ${ reprImpl[A] }

  def reprImpl[A <: AnyKind](using t: Type[A])(using ctx: QuoteContext): Expr[T[A]] =
    '{ T[A]("") }
}

Output

java.lang.AssertionError: assertion failed: position not set for Int # 4099305 of class dotty.tools.dotc.ast.Trees$TypeTree in /home/<redacted>/src/main/scala/notmacro/Main.scala

Expectation

I expect useful error about missing implicit instance

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions