Add TraverseFilter instance for Queue.#3103
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3103 +/- ##
==========================================
- Coverage 93.52% 93.51% -0.02%
==========================================
Files 368 368
Lines 6998 7011 +13
Branches 198 197 -1
==========================================
+ Hits 6545 6556 +11
- Misses 453 455 +2
Continue to review full report at Codecov.
|
kailuowang
left a comment
There was a problem hiding this comment.
Thanks! Now that Scala 2.11 was dropped from master, we no longer need binCompat traits.
|
|
a7f0097 to
f546484
Compare
| fa.iterator.map(_.show).mkString("Queue(", ", ", ")") | ||
| } | ||
|
|
||
| implicit def catsStdTraverseFilterForQueue: TraverseFilter[Queue] = QueueInstances.catsStdTraverseFilterForQueue |
There was a problem hiding this comment.
I don't know why , but implicit val catsStdTraverseFilterForQueue breaks binary compatibility.
[error] * abstract synthetic method cats$instances$QueueInstances$_setter_$catsStdTraverseFilterForQueue_=(cats.TraverseFilter)Unit in interface cats.instances.QueueInstances is present only in current version
[error] filter with: ProblemFilters.exclude[ReversedMissingMethodProblem]("cats.instances.QueueInstances.cats$instances$QueueInstances$_setter_$catsStdTraverseFilterForQueue_=")
[error] * abstract method catsStdTraverseFilterForQueue()cats.TraverseFilter in interface cats.instances.QueueInstances is present only in current version
[error] filter with: ProblemFilters.exclude[ReversedMissingMethodProblem]("cats.instances.QueueInstances.catsStdTraverseFilterForQueue")
| } | ||
|
|
||
| private object QueueInstances { | ||
| private val catsStdTraverseFilterForQueue: TraverseFilter[Queue] = new TraverseFilter[Queue] { |
There was a problem hiding this comment.
This is just an instance cache.
There was a problem hiding this comment.
I don't see this pattern as problematic but it's not very consistent with rest of the code base, can we just make the one in the trait a val instead of creating a new object?
There was a problem hiding this comment.
I get an error that
[error] * abstract synthetic method cats$instances$QueueInstances$_setter_$cats$instances$QueueInstances$$_catsStdTraverseFilterForQueue_=(cats.TraverseFilter)Unit in interface cats.instances.QueueInstances is present only in current version
[error] filter with: ProblemFilters.exclude[ReversedMissingMethodProblem]("cats.instances.QueueInstances.cats$instances$QueueInstances$_setter_$cats$instances$QueueInstances$$_catsStdTraverseFilterForQueue_=")
[error] * abstract synthetic method cats$instances$QueueInstances$$_catsStdTraverseFilterForQueue()cats.TraverseFilter in interface cats.instances.QueueInstances is present only in current version
There was a problem hiding this comment.
how did you run the check? did you get that error from sbt validateBC?
There was a problem hiding this comment.
Yes, I ran sbt validateBC.
There was a problem hiding this comment.
Adding a val to a trait will break bincompat on all Scala versions so far because of the synthetic setter that's necessary because of the way trait initialization works. The workaround here looks reasonable to me.
No description provided.