Limitations

The infix function needs to take exactly one parameter. This means:

Also, it cannot be a top-level function — the function needs to have a receiver of some form. In the preceding example, we have it as an extension function, though a regular class function is also fine.


Prev Table of Contents Next

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