Types and Type Safety in Kotlin
summary
Kotlin’s type system: local variables and single-expression function returns use type inference so you rarely annotate, while function parameters still require types. Top and bottom types are explicit: Any is the universal supertype (it maps to java.lang.Object on the JVM) and Nothing denotes code paths that never return (used for throws/todo). Nullability is encoded in bytecode metadata so ?-types are enforced at compile time; use the safe call ?. , Elvis ?:, smart casts, and safe cast as? — avoid !! and brute-force as.
AI-written summary · about
chapters (10)
- 0:00Introduction to Kotlin types
- 6:56Kotlin singletons and objects
- 9:24Any vs Object in Kotlin
- 14:26Nothing type explained
- 22:47Null safety in Kotlin
- 31:22Nullable types compilation
- 37:02Safe navigation and Elvis operator
- 43:01Type checking in Kotlin
- 45:58Smart and safe casting
- 50:10Closing remarks








