Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion core/src/main/scala/ox/resource.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ import scala.util.NotGiven
)
opaque type NoEnclosingConcurrencyScope = Unit

object NoEnclosingConcurrencyScope:
/** Scala 3.9+ erases a result of type `NoEnclosingConcurrencyScope` to `void`, earlier versions to `BoxedUnit`. Overriding this method
* makes the compiler emit both signatures, so code compiled with 3.9+ links against Ox (https://github.com/scala/scala3/issues/24653).
*/
private[ox] trait NoEnclosingConcurrencyScopeVoidErasure:
def noEnclosingConcurrencyScope(using NotGiven[OxUnsupervised]): Unit

object NoEnclosingConcurrencyScope extends NoEnclosingConcurrencyScopeVoidErasure:
// in the companion, so that it's found via the implicit scope of the type, without any imports
given noEnclosingConcurrencyScope(using NotGiven[OxUnsupervised]): NoEnclosingConcurrencyScope = ()

Expand Down
Loading