Skip to content

Commit

Permalink
chore: adding is in a branch
Browse files Browse the repository at this point in the history
Co-authored-by: Alejandro Serrano <[email protected]>
  • Loading branch information
AlejandraPedroza and serras committed Sep 26, 2024
1 parent 68b4216 commit 899156c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/topics/control-flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ sealed interface Animal {
fun feedAnimal(animal: Animal) {
when (animal) {
// Branch with only primary condition. Returns `feedDog()` when `Animal` is `Dog`
Animal.Dog -> feedDog()
is Animal.Dog -> feedDog()
// Branch with both primary and guard conditions. Returns `feedCat()` when `Animal` is `Cat` and is not `mouseHunter`
is Animal.Cat if !animal.mouseHunter -> feedCat()
// Returns "Unknown animal" if none of the above conditions match
Expand Down

0 comments on commit 899156c

Please sign in to comment.