Skip to content

Missing tasty.Reflection in quoted pattern emits unhelpful error #6436

Closed
@nicolasstucki

Description

@nicolasstucki

A missing implicit tasty.Reflection in

import scala.quoted._
import scala.quoted.matching._
def f(sc: quoted.Expr[StringContext]): Unit = {
  sc match {
    case '{ StringContext(${ExprSeq(parts)}: _*) } =>
      val ps: Seq[Expr[String]] = parts
  }
}

fails with

10 |    case '{ StringContext(${ExprSeq(parts)}: _*) } =>
   |                            ^^^^^^^^^^^^^^
   |                 Type must be fully defined.
   |                 Consider annotating the splice using a type ascription:
   |                   (${quoted.matching.ExprSeq(parts)}: XYZ).

which is not the ideal error unhelpful

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions