Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

analyzer reports unused variable of type CpsMonad as Monadic Variable #62

Closed
rssh opened this issue Nov 17, 2022 · 0 comments
Closed

analyzer reports unused variable of type CpsMonad as Monadic Variable #62

rssh opened this issue Nov 17, 2022 · 0 comments
Assignees

Comments

@rssh
Copy link
Owner

rssh commented Nov 17, 2022

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 ?

@rssh rssh self-assigned this Nov 19, 2022
@rssh rssh closed this as completed in e09a56a Nov 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant