-
Notifications
You must be signed in to change notification settings - Fork 87
fix the "Factory" type alias definition #152
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
avoid "import scala.collection.compat._" everywhere in Scala 2.11 and 2.12 collection-compat v0.2.0 ``` Welcome to Scala 2.12.6 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_181). Type in expressions for evaluation. Or try :help. scala> implicitly[scala.collection.compat.Factory[Int, List[Int]]] <console>:12: error: could not find implicit value for parameter e: collection.compat.Factory[Int,List[Int]] implicitly[scala.collection.compat.Factory[Int, List[Int]]] ^ scala> import scala.collection.compat._ import scala.collection.compat._ scala> implicitly[scala.collection.compat.Factory[Int, List[Int]]] res1: collection.compat.Factory[Int,List[Int]] = scala.collection.generic.GenTraversableFactory$$anon$1@41b12185 ``` collection-compat v0.1.1 ``` Welcome to Scala 2.12.6 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_181). Type in expressions for evaluation. Or try :help. scala> implicitly[scala.collection.compat.Factory[Int, List[Int]]] res0: scala.collection.compat.Factory[Int,List[Int]] = scala.collection.compat.Factory$$anon$1@33600943 ```
LGTM, Can you look if it fixes #137. |
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.
If we go this far then to be consistent we should remove the implicit conversion from CanBuildFrom to Factory, and maybe other conversions too.
I think the reported problem is not too important, and I do have a preference towards using |
After thinking more about it, maybe using a type alias (as proposed in this PR) is better than using Indeed, with Do other people have any thoughts about merging this PR? |
Since Factory is now a transparent type alias to CanBuildFrom, we don’t need anymore conversions from CanBuildFrom to Factory.
Thanks @xuwei-k ! |
avoid
import scala.collection.compat._
everywhere in Scala 2.12 and 2.11collection-compat v0.2.0
collection-compat v0.1.1