Skip to content

Commit 3219229

Browse files
committed
add explicit Any type parameter to methods of the PartialFunctionOps
1 parent e9b4d63 commit 3219229

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/src/main/scala/com/avsystem/commons/SharedExtensions.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -511,17 +511,17 @@ object SharedExtensionsUtils extends SharedExtensions {
511511
*/
512512
def unless(pre: PartialFunction[A, B]): PartialFunction[A, B] = pre orElse pf
513513

514-
def applyNOpt(a: A): NOpt[B] = pf.applyOrElse(a, NoValueMarkerFunc) match {
514+
def applyNOpt(a: A): NOpt[B] = pf.applyOrElse[A, Any](a, NoValueMarkerFunc) match {
515515
case NoValueMarker => NOpt.Empty
516516
case rawValue => NOpt.some(rawValue.asInstanceOf[B])
517517
}
518518

519-
def applyOpt(a: A): Opt[B] = pf.applyOrElse(a, NoValueMarkerFunc) match {
519+
def applyOpt(a: A): Opt[B] = pf.applyOrElse[A, Any](a, NoValueMarkerFunc) match {
520520
case NoValueMarker => Opt.Empty
521521
case rawValue => Opt(rawValue.asInstanceOf[B])
522522
}
523523

524-
def fold[C](a: A)(forEmpty: A => C, forNonEmpty: B => C): C = pf.applyOrElse(a, NoValueMarkerFunc) match {
524+
def fold[C](a: A)(forEmpty: A => C, forNonEmpty: B => C): C = pf.applyOrElse[A, Any](a, NoValueMarkerFunc) match {
525525
case NoValueMarker => forEmpty(a)
526526
case rawValue => forNonEmpty(rawValue.asInstanceOf[B])
527527
}

0 commit comments

Comments
 (0)