Does Kotlin have anything like discriminated unions (sum types)? What would be the idiomatic Kotlin translation of this (F#):
type OrderMessage = | New of Id
Kotlin's sealed class approach to that problem is extremely similar to the Scala sealed class and sealed trait.
Example (taken from the linked Kotlin article):
sealed class Expr { class Const(val number: Double) : Expr() class Sum(val e1: Expr, val e2: Expr) : Expr() object NotANumber : Expr() }