https://kotlinlang.org logo
#announcements
Title
# announcements
k

karelpeeters

08/01/2017, 6:29 PM
Why isn't it an error then?
d

diesieben07

08/01/2017, 6:29 PM
Because it can work if you know what you are doing, maybe. But yes, it's a bit strange.
k

karelpeeters

08/01/2017, 6:31 PM
And it just doesn't inline it if it's not possible?
d

diesieben07

08/01/2017, 6:36 PM
Well, in my example the compiler does not know that
bar
is to be inlined here, it just sees it as a normal virtual method and calls it. If the function relies on being inlined (e.g. using reified type parameters) things will blow up at runtime.
d

dumptruckman

08/01/2017, 6:38 PM
Ah, good to know, thanks