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

ClassCastException with parameterized universal trait #6385

Closed
scabug opened this issue Sep 17, 2012 · 7 comments
Closed

ClassCastException with parameterized universal trait #6385

scabug opened this issue Sep 17, 2012 · 7 comments
Assignees
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Sep 17, 2012

object N {
   def main(args: Array[String]) {
      val y: AA[Int] = C(2)
      val c: Int = y.x.y
      println(c)
   }
}
trait AA[T] extends Any {
   def x: C[T]
}
case class C[T](val y: T) extends AnyVal with AA[T] {
   def x = this
}
java.lang.ClassCastException: C cannot be cast to java.lang.Integer
	at scala.runtime.BoxesRunTime.unboxToInt(Unknown Source)
	at N$.main(N.scala:4)
	at N.main(N.scala)
@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Sep 17, 2012

Imported From: https://issues.scala-lang.org/browse/SI-6385?orig=1
Reporter: @harrah
Affected Versions: 2.10.0
See #6260

@scabug

This comment has been minimized.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Sep 18, 2012

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Nov 14, 2012

@paulp said:
Compile-time error in d435f72e5fb7f (noting for reference.)

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Oct 25, 2013

@retronym said:
Relates to the side problems reported in the comments of #6260.

I believe this was wrongly resolved with a prohibition. The problem is actually that a spurious bridge is created in cases when the overriding and overridden methods contained parameteric value classes. I have a fix for this in the works.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Oct 28, 2013

@retronym said:
Reopening, patch pending.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Oct 28, 2013

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.