Skip to content

False positive in for comprehension #11186

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

Closed
fmeriaux opened this issue Oct 2, 2018 · 1 comment
Closed

False positive in for comprehension #11186

fmeriaux opened this issue Oct 2, 2018 · 1 comment

Comments

@fmeriaux
Copy link

fmeriaux commented Oct 2, 2018

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.

@hrhino
Copy link

hrhino commented Oct 2, 2018

looks like a duplicate of #11175

@hrhino hrhino closed this as completed Oct 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants