typelevel / typelevel/sbt-typelevel

RFC: use `_` instead of `*` for kind-projector

Open
#560 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement settings
Dominant language
Scala
Stars
185
Forks
62
PR merge metrics
No merged PRs in 30d

Description

Scala 3 uses _ for kind projector and ? for existential wildcards, but supports the old */_ for compatibility with Scala 2.

I just discovered that Scala 2.12 and 2.13 can also be configured to use the new syntax.
https://github.com/typelevel/kind-projector#inline-underscore-syntax

One of the goals of sbt-typelevel v0.5.0 is to configure scalac so that it behaves more like "true" Scala 3. So I feel very tempted to make this change. We're already using the new syntax in Scala 3-only builds which has been a source of confusion when removing Scala 2 from the cross versions.

However this is a somewhat drastic change already into the RC cycle and will require a lot of existing code to be rewritten, I'm not sure how well find-replace could work.

Thoughts?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the sbt-typelevel v0.5.0 Scala compiler configuration and the kind-projector inline underscore syntax documentation linked in the issue. Determine the scope of rewriting existing Scala 2.12/2.13 code from * and _, and treat a maintainer decision on whether to make the syntax change as the completion criterion.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.