Skip to content

Commit

Permalink
address more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
massimosiani committed Jan 17, 2025
1 parent 58de8f0 commit 17209a4
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ package laws
import cats.kernel.compat.scalaVersionSpecific.*
import cats.kernel.instances.currency.*
import cats.kernel.laws.discipline.*
import cats.kernel.laws.scalaVersionSpecific.*
import munit.DisciplineSuite
import java.util.Currency
import org.scalacheck.{Arbitrary, Cogen, Gen}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright (c) 2015 Typelevel
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package cats.kernel.laws
import scala.annotation.{Annotation, StaticAnnotation}
import scala.collection.{mutable, IterableLike, TraversableLike}
import scala.collection.JavaConverters._

private[cats] object scalaVersionSpecific {

implicit class iterableExtension[A](private val s: java.lang.Iterable[A]) extends AnyVal {
def asScala: Iterable[A] = iterableAsScalaIterable(s)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@

package cats.kernel.compat
import scala.annotation.{Annotation, StaticAnnotation}
import scala.collection.{mutable, IterableLike, TraversableLike}
import scala.collection.convert.ImplicitConversionsToScala.*
import scala.collection.{IterableLike, TraversableLike}

private[cats] object scalaVersionSpecific {

Expand Down Expand Up @@ -51,8 +50,4 @@ private[cats] object scalaVersionSpecific {
that: T
)(implicit w1: A => TraversableLike[El1, Repr1], w2: T => IterableLike[El2, Repr2]) = (a, that).zipped
}

implicit class setExtension[A](private val s: java.util.Set[A]) extends AnyVal {
def asScala: mutable.Set[A] = `set asScala`(s)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ package kernel

package compat
import scala.annotation.{Annotation, StaticAnnotation}
import scala.collection.mutable
import scala.jdk.CollectionConverters.*
import scala.jdk.javaapi.CollectionConverters

private[cats] object scalaVersionSpecific {

Expand All @@ -39,6 +38,6 @@ private[cats] object scalaVersionSpecific {
}

implicit class setExtension[A](private val s: java.util.Set[A]) extends AnyVal {
def asScala: mutable.Set[A] = SetHasAsScala(s).asScala
def asScala: Iterable[A] = CollectionConverters.asScala(x)
}
}

0 comments on commit 17209a4

Please sign in to comment.