Hello,
I’ve been playing a little bit with Kotlin.
I get an unresolved reference error with the “Some#(…)” for Some.
I guess this is something trivial
public open class Option<T>
public class None<T>: Option<T>()
public class Some<T>(val s: T): Option<T>() {
fun map(f: (T) -> T): Option<T> {
return Some(f(s))
}
fun toString(): jet.String {
return “Option($s)”
}
}
fun main(args: Array<String>): Unit {
when(Some(“s”)) {
is Some#(val s is String) -> println(s)
else -> println(“Something else”)
}
}