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

explicit disabling of automatic coloring #99

Merged
merged 2 commits into from
Nov 19, 2022

Conversation

rssh
Copy link
Contributor

@rssh rssh commented Nov 19, 2022

For some reason (I'm yet not fully understand this, a bug in dotty or something like this - I will investigate now),

summonFrom[cps.automaticColoring.AutomaticColoringTag[F]]

called inside object cats-effect.cps, resolved to cps.automaticColoring.tag even if cps.automaticColoring.tag is not imported into the current scope. This trigger an analysing which trigger a message appearing in #98

To workaround against this, better explicitly disable automatic coloring by defining two tags. [I remember you don't want one in your use-case].

Regards!

@rssh rssh mentioned this pull request Nov 19, 2022
@djspiewak
Copy link
Member

Fascinating! Thank you for catching this

@@ -31,10 +32,9 @@ object cps {
transparent inline def await: A = _root_.cps.await[F, A, F](self)
}

implicit def catsEffectCpsMonadPureMemoization[F[_]](implicit F: Concurrent[F]): CpsMonadMemoization.Pure[F] =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does memoization has to do with automatic colouring in the context of dotty-cps? If not, any reason not to keep it ?

MiMa is complaining about bincompat, so it's either a case of keeping it, or prepping the version so that the next release is 0.5.0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the early days, memoization was needed in some internal interfaces for async but actually called only during automatic coloring.
Now - dotty-cps-async requires a memoization interface only if automatic coloring is enabled.
From another side, we can restore memoization for compatibility, overhead is small.

@Baccata Baccata merged commit b947147 into typelevel:main Nov 19, 2022
@Baccata
Copy link
Collaborator

Baccata commented Nov 19, 2022

Thank you for this !

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

Successfully merging this pull request may close these issues.

3 participants