rssh/dotty-cps-async

analyzer reports unused variable of type CpsMonad as Monadic Variable

rssh opened this issue · 0 comments

rssh commented

Look at typelevel/cats-effect-cps#98

      val program = async[IO]{
        async[OptionTIO](optionT.await).value.await
      }

Here internal async before macro:
before transformed:

 {
  val x$2$proxy18 = catsEffectCpsConcurrentMonad[[A] => OptionT[IO, A]](kernel.Async.asyncForOptionT[IO](IO.asyncForIO))
  await[[A] => OptionT[IO, A], scala.Int, [A] => OptionT[IO, A]](optionT)(x$2$proxy18, evidence$29)
}

After transformation become

transformed value: {
  val cpsMonad = catsEffectCpsConcurrentMonad[[A] => OptionT[[A] => IO[A], A]](kernel.Async.asyncForOptionT[IO](IO.asyncForIO))
  cpsMonad.flatDelay[scala.Int]({
    val x$2$proxy18 = catsEffectCpsConcurrentMonad[[A] => OptionT[cats.effect.IO, A]](kernel.Async.asyncForOptionT[IO](IO.asyncForIO))
    optionT
  })
}

And we see that x$2proxy18. is not used and issue warning about this.

Probems:
1: we should catch for this morning F[_], not CpsMonad[F]
2: are we need keep non-used value ?