HN user

udalov

84 karma

I work on Kotlin: kotlinlang.org

https://github.com/udalov

[ my public key: https://keybase.io/udalov; my proof: https://keybase.io/udalov/sigs/pjMGYJAla2gkaqqIo0o7WvKfoiMWEH0GhI1n31Wicr4 ]

Posts5
Comments10
View on HN

It's an error only when the 'when'-expression is used as a value, like assigned to a property, passed as an argument or returned from a function. Otherwise it's not an error. There's also a warning for matching enum values over an incomplete set of enum entries, but otherwise non-exhaustive 'when'-expression is green code.

You can basically consider 'when'-expressions to be syntax sugar over Java's if-else or ternary operator (?:) chains.

Could you please explain how the internal representation of null in the language's type system has any effect on the semantics of code written in that language?

In fact Kotlin doesn't have reified generics. This idea was planned in the beginning and was reflected in the old docs but abandoned later. I believe there's no reference to reified generics on the new web site anymore.

Not sure why they conclude that "bergamot essence may induce muscle cramps" etc based on a single case. What if the man had an allergic response of some kind and 99.99% of the population would be fine drinking so much earl grey tea?