scala3 icon indicating copy to clipboard operation
scala3 copied to clipboard

Lift Scala Settings from experimental to stabilized

Open rochala opened this issue 10 months ago • 3 comments

Fixes: https://github.com/scala/scala3/issues/19693

This is the tracking list from the issue and the status of migraton.

  • [x] lift to -X
    • [x] -Yresolve-term-conflict
    • [x] -YnoGenericSig
    • [x] -Ydumpclasses
    • [x] -YjarCompressionLevel
    • [x] -YkindProjector
    • [x] -YdropComments
    • [x] -YcookComments
    • [x] -YreadComments
    • [x] -YnoDecodeStacktraces
    • [x] -YnoEnrichErrorMessages
    • [x] -YdebugMacros
    • [ ] -YjavaTasty- deprecate in 3.7.0
    • [ ] -YjavaTastyOutput- deprecate in 3.7.0
    • [ ] -YallowOutlineFromTasty- deprecate in 3.7.0
  • [x] lift to -W
    • [x] -Wsafe-init
  • [x] to be removed
    • [x] --Yforce-inline-while-typing // Note: this was already removed by https://github.com/scala/scala3/commit/05eb7f7ae514d1db5e0bece30d63cf5a30164ee8
  • [ ] TBD
    • [ ] -YfromTastyIgnoreList // this flag was not decided
    • [x] -YoutputOnlyTasty

I suppose 2 last flags that have to be decided are maintained by @bishabosha Do you know their status ?

Other than that, this PR implemented a deprecation mechanism for the future e.g.

Deprecation(
  msg = "message",
  replacedBy = Some("newMessage"),
)

EDIT: As it was decided, options responsible for pipelining will be retained until 3.7.0. The code is commented and following PR which will deprecate them will be created after merging this one.

EDIT2: -Xlint is a very problematic flag. It was added into the compiler in 3.4 bypassing argument verification. Then in the future, when it was deprecated in favour of -Wshadow we couldn't exactly map them 1-1, and it was deprecated in following way:

  • Scala 2: -Xlint is valid flag,
  • Scala pre 3.4: -Xlint was skipped as it was not implemented,
  • Scala post 3.4 pre flag refactor: -Xlint was implemented allowing for all, private-shadow and type-parameter-shadow options. It also bypassed argument verification allowing standalone -Xlint to be ignored, not reported as error,
  • Scala post 3.4 post flag refactor: This flag was then deprecated in favour of -Wshadow. We didn't want to commit this mistake again and allow standalone -Wshadow thus when it was deprecated, we didn't handle it as we should (deprecated option should trigger replacement when possible).

That's why I'm retaining the previous behaviour of -Xlint. It will be removed in the future versions as it is already deprecated.

[test_windows_full]

rochala avatar Apr 16 '24 12:04 rochala

This has been decided to be included in the 3.5.0 release.

Note: The following flags will have to not print the deprecation warning, despite them being lifted to -X. The reason for this is that they are currently hardcoded in SBT, so we need to give users time to upgrade.

  • -YjavaTasty
  • -YjavaTastyOutput
  • -YallowOutlineFromTast

The deprecation message will be added in a future minor release (no earlier than 3.7.x), and we will remove the old syntax no later than before the next LTS version (>3.3.x).

Gedochao avatar Apr 24 '24 14:04 Gedochao

We should consider removing -Youtput-only-tasty. We do not use it internally anymore and no library should ever publish a JAR that only contains TASTy (except for the Scala 2 TASTy library).

nicolasstucki avatar Apr 25 '24 11:04 nicolasstucki

Don't auto merge this, we're still waiting for community build (full community build) to finish 😅

rochala avatar May 06 '24 14:05 rochala