Skip to content

False positive in for comprehension #11186

Closed
@fmeriaux

Description

@fmeriaux

Hello, in 2.12.7, this warning appear:

[warn] /Users/(..)/Constraint.scala:189:9: parameter value endDate in value $anonfun is never used
[warn]         endDate ← Checks.getDateTime(data, end, endFormat)
[warn]         ^
[warn] one warning found

code:

 def check(data: JsObject)(implicit failures: FailureBuffer): Unit = {
      for {
        beginDate  Checks.getDateTime(data, start, startFormat)
        endDate  Checks.getDateTime(data, end, endFormat)
        if beginDate.isAfter(endDate)
      } yield Checks.failWith(failure)
    }

PS: Checks.getDateTime returns Option[DateTime]

scalac option -Ywarn-unused:params.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions