Skip to content
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

False positive "Unconditional loop jump" #3280

Closed
ileasile opened this issue Dec 11, 2020 · 0 comments · Fixed by #3285
Closed

False positive "Unconditional loop jump" #3280

ileasile opened this issue Dec 11, 2020 · 0 comments · Fixed by #3285

Comments

@ileasile
Copy link

Given the following code:

fun f(): Int {
    for (i in 0 until 10) {
      val a = i * i
      if (a < 27) continue
      return a
    }
}

Expected Behavior

It should pass the check

Observed Behavior

It reports "unconditional loop jump" because of return statement

Steps to Reproduce

Context

Your Environment

Used detekt from codefactor.io, see https://www.codefactor.io/repository/github/kotlin/kotlin-jupyter/source/notebook-api/jupyter-lib/kotlin-jupyter-api/src/main/kotlin/org/jetbrains/kotlin/jupyter/api/KotlinKernelVersion.kt#L13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants