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

added Warning options to the list of scala3 compiler options #2959

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions _overviews/scala3-migration/options-new.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,21 @@ The current page only contains the options that were added in Scala 3.0.x.
| `-Vprofile-sorted-by:<column-name>` | Show metrics about sources and internal representations sorted by given column name. |
| `-Vprofile-details N` | Like -Vprofile, but also show metrics about sources and internal representations of the N most complex methods |

## Warning settings

| 3.3.x | description |
|-|-|
| `-Wunused:imports` | Warn about unused imports |
Copy link
Contributor

Choose a reason for hiding this comment

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

weren't all -Wunused present in Scala 2? The same for value-discard.Wnonunit-statement seems to be new, same for Wimplausible-patterns and some others.

ScalaSettings.scala#L169-L170
https://docs.scala-lang.org/overviews/compiler-options/

Copy link
Member

Choose a reason for hiding this comment

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

Scala 2 has -Wnonunit-statement

Copy link
Author

Choose a reason for hiding this comment

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

Ok, deleted options that were presented in scala-2

By the way, we need another page with all scala3 options in some other document, but this would be another issue.

Copy link
Author

Choose a reason for hiding this comment

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

But -Wnounit-statement for scala2 is not documented in https://docs.scala-lang.org/overviews/compiler-options/

Copy link
Member

@SethTisue SethTisue Mar 11, 2024

Choose a reason for hiding this comment

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

That page has long been in a grievous state of unmaintainedness, I'm ashamed to say: #1711

| `-Wunused:privates` | Warn about unused private definitions |
| `-Wunused:locals` | Warn about unused local definitions |
| `-Wunused:explicits` | Warn about unused explicit parameters |
| `-Wunused:implicits` | Warn about unused implicit parameters |
| `-Wunused:params` | Warn about all unused parameters |
| `-Wunused:all` | Enable all warnings |
| `-Wvalue-discard` | Warn about discarding values |
| `-Wnonunit-statement` | Warn when block statements are non-Unit expressions (added in 3.3.1) |


## Advanced settings

| 3.0.x | description |
Expand Down
Loading