Conversation

*Wow* , that UTF-8 change is very, very nice. And I also like the direction Java is going with records/pattern matching, and the lower level FFI and vector things :)
1
15
one could reasonably argue “you already have anon structs via tuples; surely you grok the utility of anon enums”. potential can of worms here, ie is there subtyping between `A | B` and `A | B | C` (didn’t need it for tuples but I’m not sure same trade off analysis applies here)
3
11
Because it would, at very least, complicate our calling convention and/or value representation. Consider rules like “`A <: B` implies `fn() -> A <: fn() -> B`. If we had aforementioned subtype relationship between anon enums, would have to figure out how to make those fn’s work.
1
If `A <: A | B`, then compiler needs to figure out some way that you can pass an `fn() -> A` into a context expecting a `fn() -> A | B`. These problems are “easy” to solve in a world where “everything is a reference to a heap-allocated object”, but Rust is not part of that world.
2
1
Sure, you get some of the desired outcomes here via explicit coercions. That’s how I have been interpreting the branches of this thread that talk about auto-generating Into impl’s. It certainly gets rid of a number of hairy aspects of “true subtyping”
1