Skip to content

Transparent inline skip warnings on value-discard #23018

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

Open
ahoy-jon opened this issue Apr 19, 2025 · 0 comments · May be fixed by #23019
Open

Transparent inline skip warnings on value-discard #23018

ahoy-jon opened this issue Apr 19, 2025 · 0 comments · May be fixed by #23019
Assignees
Labels
area:linting Linting warnings enabled with -W or -Xlint itype:bug

Comments

@ahoy-jon
Copy link

Compiler version

//> using scala 3.7.0-RC3
//> using option -Wvalue-discard
//> using option -Wnonunit-statement
//> using option -Wconf:msg=(unused.*value|discarded.*value|pure.*statement):error
//> using option -language:strictEquality

Minimized code

transparent inline def toto: Any = 1
def tata: Unit =
  toto

Output

{}

Expectation

[error] discarded non-Unit value of type Any. Add `: Unit` to discard silently.
[error]     toto
[error]     ^^^^
@ahoy-jon ahoy-jon added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Apr 19, 2025
@som-snytt som-snytt linked a pull request Apr 19, 2025 that will close this issue
@som-snytt som-snytt added area:linting Linting warnings enabled with -W or -Xlint and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Apr 19, 2025
@som-snytt som-snytt self-assigned this Apr 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:linting Linting warnings enabled with -W or -Xlint itype:bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants