Skip to content
18 changes: 18 additions & 0 deletions core/shared/src/main/scala-2/BinCompat.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.monovore.decline

private[decline] trait BinCompat {
@deprecated(
"This method should not be used and is only left for binary compatibility reasons",
"2.6.0"
)
def unapply(
h: Help
): Option[(List[String], cats.data.NonEmptyList[String], List[String], List[String])] =
Some(
h.errors,
h.prefix,
h.usage,
h.body
)

}
21 changes: 21 additions & 0 deletions core/shared/src/main/scala-3/BinCompat.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.monovore.decline

private[decline] trait BinCompat extends scala.deriving.Mirror.Product {
type MirroredMonoType = Help

@deprecated(
"This method should not be used and is only left for binary compatibility reasons",
"2.6.0"
)
def unapply(
h: Help
): Help = h

def fromProduct(p: scala.Product): Help =
Help(
p.productElement(0).asInstanceOf[List[String]],
p.productElement(1).asInstanceOf[cats.data.NonEmptyList[String]],
p.productElement(2).asInstanceOf[List[String]],
p.productElement(3).asInstanceOf[List[String]]
)
}
Loading