Skip to content

Commit ad2accd

Browse files
committed
Mixed up names: {contra ⇒ co}variance
1 parent a527e92 commit ad2accd

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

core/src/main/scala/japgolly/scalajs/react/Callback.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ object CallbackTo {
282282
c.toFuture.flatMap(identity)
283283
}
284284

285-
implicit def callbackContravariance[A, B >: A](c: CallbackTo[A]): CallbackTo[B] =
285+
implicit def callbackCovariance[A, B >: A](c: CallbackTo[A]): CallbackTo[B] =
286286
c.widen
287287

288288
/**

core/src/main/scala/japgolly/scalajs/react/CallbackOption.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ object CallbackOption {
144144
_ <- e.preventDefaultCB.toCBO
145145
} yield a
146146

147-
implicit def callbackOptionContravariance[A, B >: A](c: CallbackOption[A]): CallbackOption[B] =
147+
implicit def callbackOptionCovariance[A, B >: A](c: CallbackOption[A]): CallbackOption[B] =
148148
c.widen
149149
}
150150

doc/changelog/0.11.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
* Upgrade Scala.JS to 0.6.8.
3838
* Add to `Callback{,To}`: `.attemptTry` which catches non-fatal errors using a Scala `Try`.
3939
* Mounted components gain `.outerHtmlWithoutReactDataAttr()` after importing `...react.test._`.
40-
* `Callback{,To,Option}` are now contravariant by (zero-cost) implicit conversion.
40+
* `Callback{,To,Option}` are now covariant by (zero-cost) implicit conversion.
4141
* The following `Callback` methods have been changed to prevent `scalac` silent throwing away your results in certain
4242
scenarios (eg. accidentally use `.map` to another `Callback` instead of using `.flatMap`).
4343
This is a problem with Scala and `Unit` - you can experience the same with `scala.concurrent.Future` too, but at least

0 commit comments

Comments
 (0)