Details

      Description

      The following class compiles without "extends AnyVal", but with it:

      final class TraversableOnceOps[+A](val collection: TraversableOnce[A]) extends AnyVal {
        def reduceLeftOption[B >: A](op: (B, A) => B): Option[B] =
          if (collection.isEmpty) None else Some(collection.reduceLeft[B](op))
      }
      // error: type arguments [B] do not conform to method reduceLeft's type parameter bounds [B >: A]
      //            if (collection.isEmpty) None else Some(collection.reduceLeft[B](op))
      //                                                                        ^
      

      This is similar to SI-6034 and will be fixed in the same spot, with more attention to the handling of method type parameters when synthesizing the extension methods.

        Issue Links

          Activity

          Hide
          Paul Phillips added a comment -

          Fix pending.

          Show
          Paul Phillips added a comment - Fix pending.
          Show
          Paul Phillips added a comment - https://github.com/scala/scala/pull/1468
          Hide
          Jason Zaugg added a comment -
          Show
          Jason Zaugg added a comment - Fixed by: https://github.com/scala/scala/pull/1468
          Hide
          Adriaan Moors added a comment -

          reopening for 2.10.1-RC1 backport

          Show
          Adriaan Moors added a comment - reopening for 2.10.1-RC1 backport
          Show
          Jason Zaugg added a comment - https://github.com/scala/scala/pull/1976

            People

            • Assignee:
              Paul Phillips
              Reporter:
              Paul Phillips
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development