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 authored Sep 24, 2024
1 parent c25b4ee commit 9fbb260
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 9fbb260

Please sign in to comment.