Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
biboudis opened this issue Apr 13, 2018 · 3 comments
Closed

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

biboudis opened this issue Apr 13, 2018 · 3 comments
Assignees

Comments

@biboudis
Copy link
Contributor

biboudis commented Apr 13, 2018

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

@biboudis biboudis self-assigned this Apr 13, 2018
@allanrenucci
Copy link
Contributor

Still failing with #4183 merged

@biboudis
Copy link
Contributor Author

biboudis commented Apr 17, 2018

Thanks for checking!

@smarter
Copy link
Member

smarter commented Jan 28, 2019

Already fixed, regression test in #5800.

@smarter smarter closed this as completed Jan 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants