Skip to content

Commit

Permalink
Address binary compatibility issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffmay committed Jul 20, 2021
1 parent 7bc089c commit 71a6e3b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package org.scalacheck.ops

import org.scalacheck.Gen
import org.scalacheck.ops.time.{ImplicitJavaTimeGenerators, JavaTimeImplicits, TruncatedJavaTimeImplicits}
import org.scalacheck.ops.time.{ImplicitJavaTimeGenerators, JavaTimeImplicits}

import scala.language.implicitConversions
import scala.reflect.ClassTag

// TODO: Move everything to the package object to prevent inheritance here. It is bad for binary compatibility.
@deprecated("Don't extend ScalaCheckImplicits. Import from org.scalacheck.ops._ instead.", "2.7.0")
trait ScalaCheckImplicits
extends ArbitraryAsGen
with ImplicitGenFromConfig
with JavaTimeImplicits
with TruncatedJavaTimeImplicits
with ImplicitJavaTimeGenerators
with ShrinkLargeTuples {

Expand Down
4 changes: 3 additions & 1 deletion core/src/main/scala/org/scalacheck/ops/TypeName.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import scala.annotation.implicitNotFound
import scala.reflect.ClassTag

@implicitNotFound(
"Could not grab the type name of ${T} at compile-time... except for printing this error message (go figure). " +
// Splitting the $ and {T} to avoid a false missing interpolator compiler warning
// see https://stackoverflow.com/questions/39401213/disable-false-warning-possible-missing-interpolator
"Could not grab the type name of $" + "{T} at compile-time... except for printing this error message (go figure). " +
"This means that neither a ClassTag nor izumi.reflect.Tag could not be summoned for this type.")
final class TypeName[T] private (val typeName: String)

Expand Down
7 changes: 6 additions & 1 deletion core/src/main/scala/org/scalacheck/ops/package.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
package org.scalacheck

import org.scalacheck.ops.time.TruncatedJavaTimeImplicits

/**
* @note if you would like joda DateTime implicits to be included (as they were in past versions of scalacheck-ops),
* you will need to include the scalacheck-ops-joda library and import org.scalacheck.ops.time.joda._.
*/
package object ops extends ScalaCheckImplicits
package object ops
extends ScalaCheckImplicits
with ImplicitGenFromConfig
with TruncatedJavaTimeImplicits
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package org.scalacheck.ops
import io.estatico.newtype.macros.{newsubtype, newtype}

object NewtypeExample {
import scala.language.implicitConversions
import scala.language.{higherKinds, implicitConversions}

@newtype class IdType(id: String)
@newsubtype class IdSubtype(id: String)
Expand Down

0 comments on commit 71a6e3b

Please sign in to comment.