Skip to content

Case class creates an unapply method even if one is inherited in the companion object #10866

Closed
@fserre

Description

@fserre

Minimized code

abstract class B{
  def unapply(arg:A)={println ("Unapply from B"); true}
}

case class A()

object A extends B

A() match {case A() => println("done")}

Output

done

Expectation

In Scala 2.13.4, the same code would have used the unapply from B instead, and would have displayed

Unapply from B
done

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions