Skip to content

Commit

Permalink
Fix compile on 2.12
Browse files Browse the repository at this point in the history
  • Loading branch information
armanbilge committed May 27, 2024
1 parent 49fa3b2 commit 1e2bf07
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions std/shared/src/main/scala/cats/effect/std/Prop.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ import cats.data.{EitherT, IorT, Kleisli, OptionT, ReaderWriterStateT, StateT, W
import cats.effect.kernel.Sync
import cats.kernel.Monoid

import scala.jdk.CollectionConverters.PropertiesHasAsScala
import org.typelevel.scalaccompat.annotation._

import scala.collection.immutable.Map

trait Prop[F[_]] { self =>

Expand Down Expand Up @@ -130,6 +132,11 @@ object Prop {

def unset(key: String): F[Unit] = F.void(F.delay(System.clearProperty(key)))

def entries: F[Map[String, String]] = F.delay(Map.from(System.getProperties().asScala))
@nowarn213("cat=deprecation")
@nowarn3("cat=deprecation")
def entries: F[Map[String, String]] = {
import scala.collection.JavaConverters._
F.delay(Map.empty ++ System.getProperties().asScala)
}
}
}

0 comments on commit 1e2bf07

Please sign in to comment.