Skip to content

RefChecks assertion error when binding a type in pattern matching #4316

Closed
@biboudis

Description

@biboudis
object Test {

  case class Bar[A]

  def meth[A](consumer: A => Unit, s: Bar[A]): Unit = {
    s match {
      case bar: Bar[a] => {
        meth(consumer, new Bar[a]) // ok with `meth[a]`
      }
    }
  }
}

assertion failed: found: (A => Unit)(consumer)
required: a => Unit

when compiled with dotc -Ycheck:refchecks test.scala

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions