Well, the solution to [1] is obviously that you are missing a "&&".
This causes Kotlin to assume the expression:
it.address.country == "United Kingdom"
... is the expression that needs to be returned. This causes the code to spit out all people currently in the United Kingdom.
It took me a little while to notice the problem. My IDE didn't help in the slightest.
References
- [1] Problems with Kotlin
- https://randomthoughtsonjavaprogramming.blogspot.com/2024/11/problems-with-kotlin.html
No comments:
Post a Comment