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

Import MockEffOps to fix compile errors with Scala 3 #3519

Merged
merged 1 commit into from
Jan 5, 2025

Conversation

fthomas
Copy link
Member

@fthomas fthomas commented Jan 5, 2025

This is in preparation for compiling with Scala 3 and fixes errors like this:

 -- [E008] Not Found Error: modules/core/src/test/scala/org/scalasteward/core/BuiltinConfigFilesTest.scala:38:9
 36 |      val migrations = artifactMigrationsLoader
 37 |        .loadAll(ArtifactCfg(List(), disableDefaults = false))
 38 |        .runA(initialState)
    |                       ^
    |value runA is not a member of org.scalasteward.core.mock.MockEff[
    |  List[org.scalasteward.core.update.artifact.ArtifactChange]], but could be made available as an extension method.
    |
    |The following import might fix the problem:
    |
    |  import org.scalasteward.core.mock.MockEffOps

I think the change in the Scala 3 compiler that makes this import necessary, is "3. Package prefixes no longer contribute to the implicit search scope of a type".

This is in preparation for compiling with Scala 3 and fixes errors like
this:
```
 -- [E008] Not Found Error: modules/core/src/test/scala/org/scalasteward/core/BuiltinConfigFilesTest.scala:38:9
 36 |      val migrations = artifactMigrationsLoader
 37 |        .loadAll(ArtifactCfg(List(), disableDefaults = false))
 38 |        .runA(initialState)
    |                       ^
    |value runA is not a member of org.scalasteward.core.mock.MockEff[
    |  List[org.scalasteward.core.update.artifact.ArtifactChange]], but could be made available as an extension method.
    |
    |The following import might fix the problem:
    |
    |  import org.scalasteward.core.mock.MockEffOps
```

I think the change in the Scala 3 compiler that makes this import
necessary, is ["3. Package prefixes no longer contribute to the implicit search scope of a type"](https://docs.scala-lang.org/scala3/reference/changed-features/implicit-resolution.html).
@fthomas fthomas added this to the 0.32.2 milestone Jan 5, 2025
@fthomas fthomas added the testing label Jan 5, 2025
Copy link

codecov bot commented Jan 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.73%. Comparing base (e869714) to head (4ad0198).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3519   +/-   ##
=======================================
  Coverage   89.73%   89.73%           
=======================================
  Files         171      171           
  Lines        3536     3536           
  Branches      321      321           
=======================================
  Hits         3173     3173           
  Misses        363      363           

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

Copy link
Member

@mzuehlke mzuehlke left a comment

Choose a reason for hiding this comment

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

Because #2065 isn't merged, yet.
CI only tests Scala 2.13 and not Scala 3.
I guess you verified this locally.

@fthomas
Copy link
Member Author

fthomas commented Jan 5, 2025

I cherry-picked this commit from the topic/scala3 branch, so it should be fine. My idea is to break down #2065 into smaller PRs that are uncontroversial, easy to digest, and are about just one topic.

@fthomas fthomas merged commit 040cef7 into main Jan 5, 2025
12 checks passed
@fthomas fthomas deleted the topic/import-MockEffOps branch January 5, 2025 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants