-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
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 #6034 and will be fixed in the same spot, with more attention to the handling of method type parameters when synthesizing the extension methods.