Skip to content

Make Context.current a transparent inline to make it work under Scala 3.4.+#189

Merged
arainko merged 1 commit intoarainko:series/0.2.xfrom
WojciechMazur:fix/scala-3.4
Jul 23, 2024
Merged

Make Context.current a transparent inline to make it work under Scala 3.4.+#189
arainko merged 1 commit intoarainko:series/0.2.xfrom
WojciechMazur:fix/scala-3.4

Conversation

@WojciechMazur
Copy link
Contributor

It fixes compilation, and possibly usage for users of the Context.current due to scala/scala3#19253
Issue spotted by Scala 3 Open Community Build - logs
Since 3.4.0 it would fail with:

[error] -- [E172] Type Error: /Users/wmazur/projects/community-build3/repo/ducktape/src/main/scala/io/github/arainko/ducktape/internal/Planner.scala:274:32 
[error] 274 |          ctx.reifyPlan[F](plan)
[error]     |                                ^
[error]     |Cannot prove that io.github.arainko.ducktape.internal.Plan[
[error]     |  io.github.arainko.ducktape.internal.Erroneous, ctx.F] =:= io.github.arainko.ducktape.internal.Plan[
[error]     |  io.github.arainko.ducktape.internal.Erroneous, F²].
[error]     |
[error]     |where:    F  is a type in class PossiblyFallible which is an alias of io.github.arainko.ducktape.internal.Fallible
[error]     |          F² is a type in method unapply with bounds <: io.github.arainko.ducktape.internal.Fallible
[error] -- [E172] Type Error: /Users/wmazur/projects/community-build3/repo/ducktape/src/main/scala/io/github/arainko/ducktape/internal/Planner.scala:296:11 
[error] 296 |          }
[error]     |           ^
[error]     |Cannot prove that io.github.arainko.ducktape.internal.Plan[
[error]     |  io.github.arainko.ducktape.internal.Erroneous, ctx.F] =:= io.github.arainko.ducktape.internal.Plan[
[error]     |  io.github.arainko.ducktape.internal.Erroneous, F²].
[error]     |
[error]     |where:    F  is a type in class PossiblyFallible which is an alias of io.github.arainko.ducktape.internal.Fallible
[error]     |          F² is a type in method unapply with bounds <: io.github.arainko.ducktape.internal.Fallible
[error] -- [E172] Type Error: /Users/wmazur/projects/community-build3/repo/ducktape/src/main/scala/io/github/arainko/ducktape/internal/Planner.scala:315:11 
[error] 315 |          }
[error]     |           ^
[error]     |Cannot prove that io.github.arainko.ducktape.internal.Plan[
[error]     |  io.github.arainko.ducktape.internal.Erroneous, ctx.F] =:= io.github.arainko.ducktape.internal.Plan[
[error]     |  io.github.arainko.ducktape.internal.Erroneous, F²].
[error]     |
[error]     |where:    F  is a type in class PossiblyFallible which is an alias of io.github.arainko.ducktape.internal.Fallible
[error]     |          F² is a type in method unapply with bounds <: io.github.arainko.ducktape.internal.Fallible

The constraint might be also applicable for other current methods used to summon implicit, eg. Mode.current but I've not spotted any problems with it so far

@arainko
Copy link
Owner

arainko commented Jul 23, 2024

Awesome, thank you! ❤️

@arainko arainko merged commit c89672c into arainko:series/0.2.x Jul 23, 2024
@WojciechMazur WojciechMazur deleted the fix/scala-3.4 branch July 23, 2024 17:34
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.

2 participants