Calling Extension Functions

Calling an extension function is indistinguishable from calling a regular function. To the caller, they look the same, and to the developer, their syntax is identical. There is no real way to look at a function invocation and determine whether it is calling a regular function or an extension function… at least from Kotlin.

Since other languages do not necessarily have this sort of capability, you may be able to tell the difference when other code calls into Kotlin code, trying to use an extension function. We will see an example of this in an upcoming chapter on Java interoperability.


Prev Table of Contents Next

This book is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license.