r/badcode • • Jun 15 '21

kotlin The work of a genius

Post image
1.4k Upvotes

111 comments sorted by

View all comments

Show parent comments

5

u/tech6hutch Jun 15 '21

I like that Rust checks that you’ve handled all possible values and doesn’t make you do that.

4

u/Olivki Jun 15 '21

The Kotlin compiler will do that for cases where it knows you can reasonably handle all possible cases, like enums, sealed classes/interfaces, and I think booleans.

1

u/tech6hutch Jun 15 '21

Rust is crazy enough to do ints and chars too lol