Skip to content

Cannot summon Type[T] from Quotes #21696

@tribbloid

Description

@tribbloid

Compiler version

3.5.1

Minimized code

import scala.quoted.{Expr, Quotes, Type}

case class Thing[T](vs: List[String])

class BugDemo {

  object TASTyLowering {

    override protected def deserialize[T](expr: Expr[List[String]])(
        using
        qt: Quotes
    ): Expr[Thing[T]] = {

      val tt = Type.of[T](
        using
        qt
      )

      '{ Thing[T]($expr) }
    }
  }
}

Output

/home/peng/git/dottyspike/src/main/scala/com/tribbloids/spike/dotty/quoted/autolift/spike/BugDemo.scala:16:24
Reference to T within quotes requires a given scala.quoted.Type[T] in scope.


      val tt = Type.of[T](

/home/peng/git/dottyspike/src/main/scala/com/tribbloids/spike/dotty/quoted/autolift/spike/BugDemo.scala:21:16
Reference to T within quotes requires a given scala.quoted.Type[T] in scope.


      '{ Thing[T]($expr) }

the signature of Type.of[T] is:

  /** Return a quoted.Type with the given type */
  @compileTimeOnly("Reference to `scala.quoted.Type.of` was not handled by PickleQuotes")
  given of[T <: AnyKind](using Quotes): Type[T] = ???

so clearly something is wrong here

Expectation

both summoning should succeed

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions