Kotlin Tutorial #20: Inline Functions, Reified Types, and Contracts

In the previous tutorial, you learned about Flow. Now let’s learn about inline functions, reified types, and contracts. These are advanced Kotlin features that help you write faster code, work with generic types at runtime, and give the compiler extra information about your functions. In this tutorial, you will learn: Inline functions and why they matter Non-local returns noinline and crossinline Reified type parameters Contracts (callsInPlace, returns) Practical examples What Are Inline Functions? When you pass a lambda to a function, Kotlin creates a lambda object behind the scenes. This has a small performance cost: memory allocation and method calls. ...

March 22, 2026 · 9 min

Kotlin Tutorial #13: Interfaces, Generics, and Type Constraints

In the previous tutorial, you learned about sealed classes, enum classes, and value classes. Now let’s learn about interfaces, generics, and type constraints. These features let you write flexible, reusable code while keeping type safety. In this tutorial, you will learn: Interfaces and multiple inheritance Generics with <T> Type constraints with where Variance — in and out Star projection * Reified type parameters Interfaces An interface defines a contract. Classes that implement the interface must provide the required functions and properties. ...

March 22, 2026 · 8 min