Skip to content

[build] update to Scala 3.7 + update other deps #1175

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

Merged
merged 2 commits into from
May 10, 2025
Merged

[build] update to Scala 3.7 + update other deps #1175

merged 2 commits into from
May 10, 2025

Conversation

fwbrasil
Copy link
Collaborator

@fwbrasil fwbrasil commented May 9, 2025

No description provided.

@@ -151,7 +151,7 @@ object Resolvers:
req =>
val f = Unsafe.unsafely { runtime.unsafe.runToFuture(endpoint.logic(zioMonadError)(())(req)) }
KyoSttpMonad.async { cb =>
f.onComplete(r => cb(r.toEither))(ExecutionContext.parasitic)
f.onComplete(r => cb(r.toEither))(using ExecutionContext.parasitic)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the compiler now warns when passing an implicit param without using

@@ -170,7 +170,7 @@ object StreamCompression:
Present(cont),
Chunk.empty[Byte]
)))
case Absent -> _ =>
case _ =>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the compiler started complaining about exhaustiveness check

@@ -36,7 +36,7 @@ import scala.util.control.NoStackTrace
* @see
* [[Fiber.Unsafe]] for low-level operations requiring [[AllowUnsafe]]
*/
opaque type Fiber[+E, +A] = IOPromise[? <: E, ? <: A]
opaque type Fiber[+E, +A] = IOPromiseBase[E, A]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The compile crashes with [? <: E, ? <: A]. As a workaround, I've added IOPromiseBase and the new asPromise method to cast

@@ -257,7 +257,6 @@ object Queue:
object Unsafe:
extension [A](self: Unsafe[A])
def add(value: A)(using AllowUnsafe, Frame): Unit = discard(self.offer(value))
def safe: Unbounded[A] = self
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the compiler started warning for extension methods that can never be selected. In this case, Unsafe already has a safe method

@@ -238,7 +238,7 @@ object Maybe:
* @return
* the flattened Maybe
*/
inline def flatten[B](using inline ev: A <:< Maybe[B]): Maybe[B] =
def flatten[B](using ev: A <:< Maybe[B]): Maybe[B] =
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

compiler was crashing with this method inlined

@@ -6,7 +6,7 @@ type ForSome[F[_]] = ForSome.Type[F]
object ForSome:
class Unwrap[F[_], A](val unwrap: F[A]) extends AnyVal

opaque type Type[F[_]] <: Unwrap[F, ?] = Unwrap[F, ?]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@road21 the compiler was crashing and removing opaque here fixed it

Copy link
Contributor

Choose a reason for hiding this comment

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

@@ -297,7 +297,8 @@ class RecordTest extends Test:
inline def stage[Name <: String, Value](field: Field[Name, Value]): Column[Value] =
Column[Value](field.name)(using summonInline[AsColumn[Value]])

"build record if all inlined" in {
"build record if all inlined" in pendingUntilFixed {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@road21 this is still crashing. I've tried a few things without success. I'll open an issue to follow up.

Copy link
Contributor

Choose a reason for hiding this comment

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

@fwbrasil
Copy link
Collaborator Author

fwbrasil commented May 9, 2025

I've also updated other dependencies since scala steward is still not working. I'll try to enable the renovate bot instead

@fwbrasil fwbrasil changed the title [build] update to Scala 3.7 [build] update to Scala 3.7 + update other deps May 9, 2025
@hearnadam hearnadam merged commit b819863 into main May 10, 2025
3 checks passed
@hearnadam hearnadam deleted the scala-3-7 branch May 10, 2025 02:54
fwbrasil pushed a commit that referenced this pull request May 14, 2025
Fix `pendingUntilFixed` test of `Record.stage` after migrating to 3.7.0
(in #1175)

Firstly, I have fixed problems with `unlimited recursion` which was
similar to (scala/scala3#23137). I have just
made scopes of opaque types (`AsFields, AsField`) inside `Record`
narrower.

Secondly, I have faced with interesting behavior: moving bound
`AsFields` from `unsafeFrom` to `StageOps.apply` changes compiler
result. I've spent a lot of time to minimize it to scala compiler bug,
but no succeeded.
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