Skip to content

Transparent inline skip warnings on value-discard #23018

Open
@ahoy-jon

Description

@ahoy-jon

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]     ^^^^

Metadata

Metadata

Assignees

Labels

area:lintingLinting warnings enabled with -W or -Xlintitype:bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions