https://kotlinlang.org logo
#language-proposals
Title
# language-proposals
m

marstran

05/22/2018, 2:29 PM
Let's say you have two interface-methods that only differs in its return type, and where one type is a subtype of the other. Can you implement both with a single method?
Copy code
interface A {
  fun foo(): Any
  fun foo(): String
}

class B : A {
  override fun foo(): String = "Hello world!"
}