louiscad
10/22/2019, 9:29 AMIlmir Usmanov [JB]
10/22/2019, 9:57 AMlouiscad
10/22/2019, 10:03 AMkarelpeeters
10/22/2019, 10:46 AMinterface Foo {
fun foo()
}
class Bar: Foo {
override inline fun foo() = print("test")
}
fun main() {
val x: Bar = Bar()
val y: Foo = Bar()
x.foo()
y.foo()
}
x.foo()
is inlined, y.foo()
is not.Ilmir Usmanov [JB]
10/22/2019, 10:53 AMIt's only using the inline function for private usage, or it can go beyond?Depends on what you mean by "beyond". It is just like normal function in bytecode and you can call it from Java.
louiscad
10/22/2019, 11:50 AMInterfaceA
, ClassB
, someProperty
, etc are more readable, don't you think?louiscad
10/22/2019, 11:51 AMkarelpeeters
10/22/2019, 1:10 PM