Skip to content
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

Compile with Scala 3 #2065

Closed
wants to merge 50 commits into from
Closed

Compile with Scala 3 #2065

wants to merge 50 commits into from

Conversation

fthomas
Copy link
Member

@fthomas fthomas commented Apr 6, 2021

No description provided.

@fthomas
Copy link
Member Author

fthomas commented Apr 6, 2021

The Scala 3 build fails with:

[info] compiling 141 Scala sources to /home/runner/work/scala-steward/scala-steward/modules/core/.jvm/target/scala-3.0.0-RC2/classes ...
exception caught when loading trait GenConcurrent: java.lang.AssertionError: assertion failed: duplicate type F#45910; previous was type F#45561
[info] assertion failure for org.scalasteward.core.application.Context.type <:< ?{ step0: ? }, frozen = false
[info] exception occurred while typechecking /home/runner/work/scala-steward/scala-steward/modules/core/src/main/scala/org/scalasteward/core/Main.scala

It seems we're hitting scala/scala3#11173 here.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
@fthomas
Copy link
Member Author

fthomas commented Feb 8, 2023

The following dependencies are currently not available for Scala 3:

@fthomas
Copy link
Member Author

fthomas commented Jan 5, 2025

circe-generic-extras is not an issue anymore since it has been removed recently.

Copy link

codecov bot commented Jan 5, 2025

Codecov Report

Attention: Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.

Project coverage is 89.78%. Comparing base (dd4b207) to head (e3d32a4).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...la/org/scalasteward/core/application/Context.scala 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2065      +/-   ##
==========================================
+ Coverage   89.73%   89.78%   +0.05%     
==========================================
  Files         171      171              
  Lines        3536     4983    +1447     
  Branches      321      504     +183     
==========================================
+ Hits         3173     4474    +1301     
- Misses        363      509     +146     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

fthomas added a commit that referenced this pull request Jan 5, 2025
This is in preparation for compiling with Scala 3 and prevents warnings
about pattern bindings with refutable patterns like this:
```
 -- Warning: modules/core/src/test/scala/org/scalasteward/core/update/PruningAlgTest.scala:218:27
 218 |    val Right(repoCache) = decode[RepoCache](
     |                           ^
     |pattern's type Right[io.circe.Error, org.scalasteward.core.repocache.RepoCache] is more specialized than the right hand side expression's type Either[io.circe.Error, org.scalasteward.core.repocache.RepoCache]
     |
     |If the narrowing is intentional, this can be communicated by adding `: @unchecked` after the expression,
     |which may result in a MatchError at runtime.
     |This patch can be rewritten automatically under -rewrite -source 3.2-migration.
```
The changes here we done by the Scala 3 compiler by using the
`-rewrite -source 3.2-migration` options.

Relevant documentation: https://docs.scala-lang.org/scala3/reference/changed-features/pattern-bindings.html

The changes here are another large chunk of #2065 and have been
cherry-picked from that branch.
fthomas added a commit that referenced this pull request Jan 5, 2025
This is in preparation for compiling with Scala 3 and prevents warnings
about pattern bindings with refutable patterns like this:
```
 -- Warning: modules/core/src/test/scala/org/scalasteward/core/update/PruningAlgTest.scala:218:27
 218 |    val Right(repoCache) = decode[RepoCache](
     |                           ^
     |pattern's type Right[io.circe.Error, org.scalasteward.core.repocache.RepoCache] is more specialized than the right hand side expression's type Either[io.circe.Error, org.scalasteward.core.repocache.RepoCache]
     |
     |If the narrowing is intentional, this can be communicated by adding `: @unchecked` after the expression,
     |which may result in a MatchError at runtime.
     |This patch can be rewritten automatically under -rewrite -source 3.2-migration.
```
The changes here we done by the Scala 3 compiler by using the
`-rewrite -source 3.2-migration` options. They are another large
chunk of #2065 that have been cherry-picked from that branch.

Relevant documentation: https://docs.scala-lang.org/scala3/reference/changed-features/pattern-bindings.html
@fthomas
Copy link
Member Author

fthomas commented Jan 7, 2025

Closing in favor of #3527.

@fthomas fthomas closed this Jan 7, 2025
@fthomas fthomas deleted the topic/scala3 branch January 7, 2025 11:27
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