Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
serras committed Apr 2, 2024
1 parent 671b0b1 commit 6cd7357
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions proposals/guards.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ involved, we recommend using nested conditionals instead.
```kotlin
// don't do this
when (status) {
is Status.Error && status.problem == Problem.CONNECTION -> ...
is Status.Error && status.problem == Problem.AUTHENTICATION -> ...
is Status.Error && status.problem == Problem.UNKNOWN -> ...
is Status.Error if status.problem == Problem.CONNECTION -> ...
is Status.Error if status.problem == Problem.AUTHENTICATION -> ...
is Status.Error if status.problem == Problem.UNKNOWN -> ...
// the compiler requires an additional 'is Status.Error' case
}

Expand Down

0 comments on commit 6cd7357

Please sign in to comment.