Skip to content

Commit

Permalink
Fixed warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Grryum committed Nov 22, 2023
1 parent ea26dbe commit 9a0e38b
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ object CargoApp extends IOApp {

implicit val logMakeTraced: Logging.Make[TracedIO] = Logging.Make.contextual[TracedIO, Trace]
implicit val logMake: Logging.Make[IO] = Logging.Make.plain[IO]
implicit val appLogger = logMake.byName("CargoApp")
implicit val appLogger: Logging[IO] = logMake.byName("CargoApp")

val endpoints = Endpoints.cargoEndpoints[IO, TracedIO](
CargoService.make(MovingCompany.make[TracedIO], Warehouse.makeSmall[TracedIO])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ object CargoApp extends IOApp {

implicit val logMakeTraced: Logging.Make[TracedIO] = Logging.Make.contextual[TracedIO, Trace]
implicit val logMake: Logging.Make[IO] = Logging.Make.plain[IO]
implicit val appLogger = logMake.byName("CargoApp")
implicit val appLogger: Logging[IO] = logMake.byName("CargoApp")

val endpoints = Endpoints.cargoEndpoints[IO, TracedIO](
CargoService.make(MovingCompany.make[TracedIO], Warehouse.makeSmall[TracedIO])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ object CargoApp extends IOApp {

implicit val logMakeTraced: Logging.Make[TracedIO] = Logging.Make.contextual[TracedIO, Trace]
implicit val logMake: Logging.Make[IO] = Logging.Make.plain[IO]
implicit val appLogger = logMake.byName("CargoApp")
implicit val appLogger: Logging[IO] = logMake.byName("CargoApp")

val endpoints = Endpoints.cargoEndpoints[IO, TracedIO](
CargoService.make(MovingCompany.make[TracedIO], Warehouse.makeSmall[TracedIO])
Expand Down
7 changes: 4 additions & 3 deletions modules/core/ce2/src/test/scala/tofu/ScopedSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import scala.concurrent.ExecutionContext
import cats.effect.Blocker
import tofu.syntax.scoped.*
import tofu.syntax.monadic.*
import tofu.compat.unused
import scala.annotation.nowarn
import scala.concurrent.Future

class ScopedSuite {
@nowarn("cat=unused-params")
def doSomething[F[_]: ContextShift: Async, A](fa: F[A], ea: => A)(calcEc: ExecutionContext)(implicit
@unused ec: ExecutionContext,
@unused block: Blocker
ec: ExecutionContext,
block: Blocker
): F[List[A]] = {
implicit val exec: CalcExec[F] = Scoped.makeExecuteCE2(calcEc)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ trait ContextTInstancesR extends ContextTInstancesS { self: ContextTInstances =>
final implicit def contextTContext[F[+_]: Applicative, C[_[_]]]: ContextTContext[F, C] =
new ContextTContext

final implicit def contextTNonEmptyParallel[F[+_]: NonEmptyParallel, C[_[_]]: InvariantK] =
new ContextTNonEmptyParallelI[F, C]
final implicit def contextTNonEmptyParallel[F[+_]: NonEmptyParallel, C[_[_]]: InvariantK]
: ContextTNonEmptyParallelI[F, C] = new ContextTNonEmptyParallelI[F, C]
}

trait ContextTInstancesQ extends ContextTInstancesR { self: ContextTInstances =>
Expand Down Expand Up @@ -175,7 +175,8 @@ trait ContextTInstancesP extends ContextTInstancesQ { self: ContextTInstances =>
rc1: Rebase[In],
): Unlift[ContextT[F, In, *], ContextT[F, Out, *]] = {
class uloi(implicit c2c: Out[ContextT[F, Out, *]]) extends Unlift[ContextT[F, Out, *], ContextT[F, In, *]] {
implicit def self = this
implicit def self: Unlift[ContextT[F, Out, *], ContextT[F, In, *]] = this

def lift[A](c2a: ContextT[F, Out, A]): ContextT[F, In, A] =
c1c => c2a.run(l.set(c2c, rc1.rebase(c1c)))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ object ZioHasBuilder {
class UnHas[U](val loggable: Loggable[U]) extends AnyVal

object UnHas {
implicit def unHas[S: Tag](implicit S: Loggable[S]) =
implicit def unHas[S: Tag](implicit S: Loggable[S]): UnHas[Has[S]] =
new UnHas[Has[S]](S.contramap(_.get))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,6 @@ object Logs extends LogsInstances with LogsInstances0 {
}

/** Set of useful syntax stuff for Logs */
implicit def ops[I[_], F[_]](logs: Logs[I, F]) = new LogsInvariantSyntax.LogsOps[I, F](logs)
implicit def ops[I[_], F[_]](logs: Logs[I, F]): LogsInvariantSyntax.LogsOps[I, F] =
new LogsInvariantSyntax.LogsOps[I, F](logs)
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class LoggableSuite extends AnyFlatSpec with Matchers {
json(TestInt(-1)) shouldBe """{"missing":null,"sign":"negative","value":-1}"""
}

implicit val testLoggableEither = Loggable.either[String, Int].named("kek")
implicit val testLoggableEither: Loggable[Either[String, Int]] = Loggable.either[String, Int].named("kek")

"either custom logging" should "handle left" in {
json("lol".asLeft[Int]) shouldBe """{"kek":"lol"}"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ object WriterLogs extends Logs[Id, Writer[List[String], *]] {

class TestService {
type Run[A] = Writer[List[String], A]
implicit val logger = WriterLogs.byName("TestLogger")
implicit val logger: Logging[Writer[List[String], *]] = WriterLogs.byName("TestLogger")

def sayHello(name: String): Run[String] =
for {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import monix.reactive.observers.Subscriber

import scala.concurrent.Future
import scala.util.control.NonFatal
import monix.execution.Scheduler

//shameless copy of monix.reactive.internal.operators.TakeByPredicateOperator
private[observable] final case class TakeWhileInclusive[A](p: A => Boolean, out: Subscriber[A]) extends Subscriber[A] {
implicit val scheduler = out.scheduler
private[this] var isActive = true
implicit val scheduler: Scheduler = out.scheduler
private[this] var isActive = true

def onNext(elem: A): Future[Ack] = {
if (!isActive) Stop
Expand Down

0 comments on commit 9a0e38b

Please sign in to comment.