-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port IRT Runtime to Scala 3; use Match Types as type projections work…
…around to minimize changes and support Http4sContext type scala/scala3#13416
- Loading branch information
Showing
22 changed files
with
331 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...1/idealingua-v1-core/src/main/scala/izumi/idealingua/model/publishing/BuildManifest.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 3 additions & 5 deletions
8
...v1/idealingua-v1-model/src/main/scala/izumi/idealingua/model/common/StreamDirection.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
package izumi.idealingua.model.common | ||
|
||
sealed trait StreamDirection { | ||
|
||
} | ||
sealed trait StreamDirection | ||
|
||
object StreamDirection { | ||
final case object ToServer extends StreamDirection | ||
final case object ToClient extends StreamDirection | ||
case object ToServer extends StreamDirection | ||
case object ToClient extends StreamDirection | ||
} |
19 changes: 19 additions & 0 deletions
19
...-v1-runtime-rpc-http4s/src/main/scala-2/izumi/idealingua/runtime/rpc/http4s/package.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package izumi.idealingua.runtime.rpc | ||
|
||
package object http4s { | ||
|
||
/** | ||
* This is a workaround that replaces usages of type projections with Match Types on Scala 3. | ||
* | ||
* See: https://github.com/lampepfl/dotty/issues/13416 | ||
*/ | ||
type GetBiIO[C <: Http4sContext] = { type l[+E, +A] = C#BiIO[E, A] } | ||
type GetMonoIO[C <: Http4sContext] = { type l[+A] = C#BiIO[Throwable, A] } | ||
|
||
type GetMaterializedStream[C <: Http4sContext] = C#MaterializedStream | ||
type GetRequestContext[C <: Http4sContext] = C#RequestContext | ||
type GetClientContext[C <: Http4sContext] = C#ClientContext | ||
type GetMethodContext[C <: Http4sContext] = C#MethodContext | ||
type GetClientMethodContext[C <: Http4sContext] = C#ClientMethodContext | ||
type GetClientId[C <: Http4sContext] = C#ClientId | ||
} |
31 changes: 31 additions & 0 deletions
31
...-v1-runtime-rpc-http4s/src/main/scala-3/izumi/idealingua/runtime/rpc/http4s/package.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package izumi.idealingua.runtime.rpc | ||
|
||
package object http4s { | ||
|
||
/** | ||
* This is a workaround that replaces usages of type projections with Match Types on Scala 3. | ||
* | ||
* See: https://github.com/lampepfl/dotty/issues/13416 | ||
*/ | ||
type GetBiIO[C <: Http4sContext] = { type l[+E, +A] = C match { | ||
case GetBiIOPattern[f] => f[E, A] | ||
} } | ||
type GetMonoIO[C <: Http4sContext] = { type l[+A] = C match { | ||
case GetBiIOPattern[f] => f[Throwable, A] | ||
} } | ||
type GetMaterializedStream[C <: Http4sContext] = C match {case GetMaterializedStreamPattern[t] => t} | ||
type GetRequestContext[C <: Http4sContext] = C match {case GetRequestContextPattern[t] => t} | ||
type GetClientContext[C <: Http4sContext] = C match {case GetClientContextPattern[t] => t} | ||
type GetMethodContext[C <: Http4sContext] = C match {case GetMethodContextPattern[t] => t} | ||
type GetClientMethodContext[C <: Http4sContext] = C match {case GetClientMethodContextPattern[t] => t} | ||
type GetClientId[C <: Http4sContext] = C match {case GetClientIdPattern[t] => t} | ||
|
||
type GetBiIOPattern[F[+_, +_]] = Http4sContext { type BiIO[+E, +A] = F[E, A] } | ||
type GetMaterializedStreamPattern[T] = Http4sContext { type MaterializedStream = T } | ||
type GetRequestContextPattern[T] = Http4sContext { type RequestContext = T } | ||
type GetClientContextPattern[T] = Http4sContext { type ClientContext = T } | ||
type GetMethodContextPattern[T] = Http4sContext { type MethodContext = T } | ||
type GetClientMethodContextPattern[T] = Http4sContext { type ClientMethodContext = T } | ||
type GetClientIdPattern[T] = Http4sContext { type ClientId = T } | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.