Skip to content

Desugaring problem with StringContext in PatDef #1748

Closed
@liufengyun

Description

@liufengyun

Following code failed to compile in Dotty, but it's fine in Scala:

object Test {
  implicit class Foo(sc: StringContext) {
    object q {
      def unapply(args: Any*): Option[(Any, Any)] =
        Some((sc.parts(0), sc.parts(1)))
    }
  }

  def f(defn: Any): Any = {
    val q"class $name extends $parent" =  defn
    println(name)
    println(parent)
  }
}

It turns out in Desugaring, a case for Thicket is missing.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions