Scala Programming Language
  1. Scala Programming Language
  2. SI-6600

ScalaNumericConversions regression caused by AnyVal and implementation of byteValue/shortValue

    Details

      Description

      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 {
                         ^
      

        Activity

        Show
        Paul Phillips added a comment - https://github.com/scala/scala/pull/1562

          People

          • Assignee:
            Paul Phillips
            Reporter:
            Simon Ochsenreither
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development