-
Notifications
You must be signed in to change notification settings - Fork 87
Fix broken .travis.yml #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
a9efc2d
to
3d7a37e
Compare
@julienrf ready for review, this one is important since it unblocks CI. |
|
||
package object compat extends compat.PackageShared { | ||
implicit def toImmutableSortedMapExtensions(fact: i.SortedMap.type): compat.ImmutableSortedMapExtensions = | ||
new compat.ImmutableSortedMapExtensions(fact) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this related with the PR description?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A previous PR was merged but was broken for 2.11. This fix this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to have the following? // scala-2.11_2.12/CompatShared.scala
trait CompatShared {
implicit class IterableFactoryExtensionMethods[CC[X] <: GenTraversable[X]](private val fact: GenericCompanion[CC]) {
def from[A](source: TraversableOnce[A]): CC[A] =
fact.apply(source.toSeq: _*)
}
// same for all other definitions that are compatible with 2.11 and 2.12
}
// scala-2.11/compat.scala
package object compat extends CompatShared
// scala-2.12/compat.scala
package object compat extends CompatShared {
implicit class MutableTreeMapExtensions2(private val fact: m.TreeMap.type) extends AnyVal {
def from[K: Ordering, V](source: TraversableOnce[(K, V)]): m.TreeMap[K, V] =
build(m.TreeMap.newBuilder[K, V], source)
}
// same with all 2.12 specific definitions
} So that there is no duplication between scala-2.11 and scala-2.12? |
You suggest dropping the |
No, you’re right we should keep extending // scala-2.11_2.12
trait CompatShared {
implicit def sharedExtensions(receiver: Foo): FooExtensions = new CompatShared.FooExtensions(receiver)
}
object CompatShared {
class FooExtensions(private val receiver: Foo) extends AnyVal {
// some extension methods…
}
}
// scala-2.11
package object compat extends CompatShared
// scala-2.12
package object compat extends CompatShared {
// more extension methods that are specific to scala 2.12
} |
Oh, of course, nice catch. |
mutable.TreeMap and mutable.ListMap are not available in 2.11. It's not possible to put implicit classes in a shared trait. We have to duplicate a bit the api
9be08f9
to
68d8300
Compare
@julienrf done, rebased. |
@julienrf ci is green. |
@julienrf it looks like the cross-compat breakOut PR was broken. I'm fixing it here. I'm also re-enabling CI.