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.
Activity
scabug commentedon Oct 6, 2012
Imported From: https://issues.scala-lang.org/browse/SI-6482?orig=1
Reporter: @paulp
scabug commentedon Oct 6, 2012
@paulp said:
Fix pending.
scabug commentedon Oct 8, 2012
@paulp said:
scala/scala#1468
scabug commentedon Jan 9, 2013
@retronym said:
Fixed by: scala/scala#1468
scabug commentedon Jan 22, 2013
@adriaanm said:
reopening for 2.10.1-RC1 backport
scabug commentedon Jan 26, 2013
@retronym said:
scala/scala#1976