Skip to content

PatDef desugaring problem #1773

Closed
Closed
@liufengyun

Description

@liufengyun

Following code compiles fine in scalac but failed to compile in dotty. The cause is mostly like to be unmatched cases when desugaring patdef, as in #1748 .

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

  def main(args: Array[String]): Unit = {
    val q"class ${name: String} extends ${parent: String}" = new Object
    println(name)
    println(parent)
  }
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions