Skip to content

explicit disabling of automatic coloring#99

Merged
Baccata merged 2 commits intotypelevel:mainfrom
rssh:disable-automatic-coloring
Nov 19, 2022
Merged

explicit disabling of automatic coloring#99
Baccata merged 2 commits intotypelevel:mainfrom
rssh:disable-automatic-coloring

Conversation

@rssh
Copy link
Copy Markdown
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
Copy Markdown
Member

Fascinating! Thank you for catching this

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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