https://kotlinlang.org logo
Title
m

mzgreen

11/17/2019, 9:54 PM
I stumbled upon this interesting code sample today: https://discuss.kotlinlang.org/t/compound-extension/10722/41 Can anyone explain why does it behave like that?
s

Shawn A

11/17/2019, 10:02 PM
Is there a typo in this code sample?
open class B
class B1 : A()
shouldn't that be
class B1 : B()
?
If so, then the program fails with
Overload resolution ambiguity:
f

Fudge

11/17/2019, 11:44 PM
You probably meant to make B1 implement B. As it stands it implements A
So only the second overload is valid for the inputs
m

mzgreen

11/18/2019, 5:28 AM
It's not my code, I was just curious but you are right, thank you folks! :)