You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following class compiles without "extends AnyVal", but with it:
finalclassTraversableOnceOps[+A](valcollection:TraversableOnce[A]) extendsAnyVal {
defreduceLeftOption[B>:A](op: (B, A) =>B):Option[B] =if (collection.isEmpty) NoneelseSome(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.
The text was updated successfully, but these errors were encountered:
The following class compiles without "extends AnyVal", but with it:
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.
The text was updated successfully, but these errors were encountered: