Skip to content

Conversation

liufengyun
Copy link
Contributor

Fix #4030: avoid adding duplicate binders

sealed trait Root[T]
case object C1 extends Root[Int]
case object C2 extends Root[String]
//case class C3[X, Y]() extends Root[X|Y|(X => X)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let’s drop the comments I guess...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All comments removed.

def f[A <: Seq[_], B, Foo >: A => B](v: Root[Foo], u: Root[Foo]) = (v, u) match {
//case C1 =>
//case C2 =>
case (C3(), C3()) =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, shouldn’t there be a checkfile for the exhaustivity warning triggered by this code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved the test to be a patmat test and added a check file. For pos/neg tests, we don't have check files.

case _ =>
unapp
def addBinders(unapp: Tree, bound: List[Symbol]) = {
var remain = bound.toSet
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this in case TypeApply(fn, args) =>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants