Skip to content

[Scala 3] convert wildcard imports to Scala 3 syntax#875

Open
halotukozak wants to merge 6 commits into
AVSystem:scala-3from
halotukozak:03-08-wildcard-imports
Open

[Scala 3] convert wildcard imports to Scala 3 syntax#875
halotukozak wants to merge 6 commits into
AVSystem:scala-3from
halotukozak:03-08-wildcard-imports

Conversation

@halotukozak

Copy link
Copy Markdown
Member

Summary

Mechanical syntax sweep: convert Scala 2 wildcard and rename imports to Scala 3 syntax.

  • import X._import X.* (top-level and method-scoped)
  • import X.{Y => Z}import X.Y as Z (and multi-selector {Y as Z} variants)
  • import java.io.{ObjectInput => _, _}import java.io.{ObjectInput as _, *}
  • Scaladoc import examples updated to match.

No behavioral change; pure syntax modernization. Scope excludes analyzer/ (will-not-migrate) and jetty/ (deferred module).

Commits

  • refactor(scala-3,core): wildcard imports ._ → .*
  • refactor(scala-3,mongo): wildcard imports ._ → .*
  • refactor(scala-3,hocon): wildcard imports ._ → .*
  • refactor(scala-3,benchmark): wildcard imports ._ → .*
  • refactor(scala-3): rename imports => → as, nested wildcards ._ → .*
  • docs(migration): record import syntax modernization

Metadata

  • Slice: 3.8
  • Independent: yes
  • Depends-on: none
  • Base: upstream/scala-3

Verification

  • git grep -nE '^import .*\._$' -- '*.scala' → 0 hits (scope)
  • sbt scalafmtCheckAll → green
  • sbt compile Test/compile → green
  • No new @nowarn / -Wconf

- Convert `import X.{Y => Z}` rename clauses to `import X.Y as Z` / `{Y as Z}`.
- Convert `import X.{Y => _, _}` exclude+wildcard to `{Y as _, *}`.
- Convert indented `import X._` (inside class/method bodies) to `import X.*`.
- Update scaladoc `* import X._` examples to Scala 3 syntax.
@halotukozak halotukozak added this to the Scala 3 milestone Jun 1, 2026
@halotukozak halotukozak marked this pull request as ready for review June 1, 2026 21:45
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.

1 participant