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

ScalaNumericConversions regression caused by AnyVal and implementation of byteValue/shortValue #6600

Closed
scabug opened this issue Oct 31, 2012 · 2 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Oct 31, 2012

the following code snippet compiles with 2.9.2:

final class Natural extends scala.math.ScalaNumber with scala.math.ScalaNumericConversions {
  def intValue(): Int = 0
  def longValue(): Long = 0L
  def floatValue(): Float = 0.0F
  def doubleValue(): Double = 0.0D
  def isWhole(): Boolean = false
  def underlying() = this
}

But both 2.10.0-RC1 and 2.11.0-20121023-093421-b480d99107 report the following error:

<console>:7: error: class Natural inherits conflicting members:
  method byteValue in class Number of type ()Byte  and
  method byteValue in trait ScalaNumericConversions of type ()Byte
(Note: this can be resolved by declaring an override in class Natural.);
 other members with override errors are: shortValue
       final class Natural extends scala.math.ScalaNumber with scala.math.ScalaNumericConversions {
                   ^
@scabug
Copy link
Author

scabug commented Oct 31, 2012

Imported From: https://issues.scala-lang.org/browse/SI-6600?orig=1
Reporter: @soc
Affected Versions: 2.10.0, 2.11.0-M1, 2.11.0
Other Milestones: 2.10.0

@scabug
Copy link
Author

scabug commented Nov 2, 2012

@paulp said:
scala/scala#1562

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

No branches or pull requests

2 participants