Skip to content

WUnused false positive in for #17175

Closed
@szymon-rd

Description

@szymon-rd

Compiler version

3.3.0-RC2 (not fixed with any PR merged by now [29.03.23])

Minimized code

val continue = true

@main
def main =
  for {
    i <- 1.until(10)
    if continue
  } {
    println(i)
  }

Run with -Wunused:all

Output

-- Warning: Test.scala:18:4 ---------------------------------------------------
18 |    i <- 1.until(10)
   |    ^
   |    unused explicit parameter

Expectation

No warning

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions