top | item 33726302

(no title)

Casperin | 3 years ago

It has no adts at all. Like I'm reading blog posts right now about how to do what should be the simplest thing

    enum Foo {
        A(String),
        B(i32),
    }
And it's.. not simple. And even if you manage to do it, it'll never be how Kotlin was meant to be written.

discuss

order

vips7L|3 years ago

Its pretty simple:

    sealed interface Foo
    class A(val s: String): Foo
    class B(val b: Int): Foo

bpicolo|3 years ago

I agree with you 100%. It's the thing I miss most when not writing Rust. I will say that it as a feature alone isn't a good enough reason for me to write Rust, though!