Kotlin / kotlin-spec

Kotlin Language Specification:
https://kotlinlang.org/spec
Apache License 2.0
387 stars 80 forks source link

Grammar: inconsistency with in vs && #82

Closed belyaev-mikhail closed 3 years ago

belyaev-mikhail commented 3 years ago

In actual kotlin, the following code has different priority:

when (x) {
       in y && z -> /* parsed as in (y && z) */
}
when {
      x in y && z -> /*  parsed as (x in y) && z */
}

We need to recheck it against the grammar

belyaev-mikhail commented 3 years ago

Works as intended