Why covariance is needed in the following example?
This might be a dumb question but I cannot wrap my head around this example:
open class Case {}
class InheritedCase: Case()
fun getCase(): Case = InheritedCase()
Can someone explain why out must be specified and why a compile error is thrown when only using String?