Kotlin requires explicit cast to Object
I am trying to write a method in Kotlin that returns an object of type Object.
In Java I would simply write this as
public Object test() {
return "Bla";
}
However, in Kotlin this does not work and throws an error
fun test(): Object {
return "Bla"
}
When casting the string return "Bla" as Object it works. Interestingly, the Kotlin Object is imported from java.utils and is probably not the same Object as it is in the Java code.
Why is this so? Does Kotlin not want you to return...