Skip to content

Incomplete equality generated for nested case classes with type parameters #7281

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
b-studios opened this issue Sep 21, 2019 · 0 comments · Fixed by #14855
Closed

Incomplete equality generated for nested case classes with type parameters #7281

b-studios opened this issue Sep 21, 2019 · 0 comments · Fixed by #14855

Comments

@b-studios
Copy link
Contributor

b-studios commented Sep 21, 2019

When compared for equality, nested case classes with type parameters do not check for their parent object.

Tried on latest Dotty nightly. Scala 2 shows expected behavior

minimized code

trait T {
    case class X[A]()
}

object a extends T
object b extends T

val ax = a.X()
val bx = b.X()

println(ax == bx)

expectation

The equality check should print false but prints true.

Deleting the type parameter [A] on the case class shows the correct behavior.

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

Successfully merging a pull request may close this issue.

2 participants