Skip to content
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

Specialization regression in Scala 2.12 (specialized traits) #11707

Open
kamilkloch opened this issue Aug 22, 2019 · 0 comments

Comments

@kamilkloch
Copy link

commented Aug 22, 2019

The following code

case class A[@specialized(Double) T](_x: T) extends SpecializedOps[T]

trait SpecializedOps[@specialized(Double) T] {
    self: A[T] =>

    def x: T = self._x
}
A(1.0).x

boxes on Scala 2.12.9, does not box on 2.11.12. When def x: T is overriden in A

case class A[@specialized(Double) T](_x: T) extends SpecializedOps[T] {
  override def x: T = _x
}

no boxing on Scala 2.12.9 occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.