I have a proposal: How about make extension functi...
# language-proposals
s
I have a proposal: How about make extension function implement interfaces:
Copy code
interface SomeInterface {
    fun hi()
}

class SomeClass: SomeInterface {

}

fun SomeClass.hi() {
    print("hi")
}
So, My proposal is that the compiler can infer the interface conformance with the extension function implementation and not show an error in the class declaration. What do you think guys?
v
Please clarify how you would like such code to behave on JVM. Should corresponding Java classes implement the interfaces? Should they not?
Also, a proposal must include use cases, e.i situations you have encountered that would benefit from this feature
o
Also please edit your post to use triple backticks for code
t
you mean ad-hoc polymorphism? I want it too, but it's been rejected a lot of times already