~/talk

Types and Type Safety in Kotlin

Talkat Developer Summit 2020 · 2020-11-21..11-22· [kotlin]
slides:none on file

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

  1. 0:00Introduction to Kotlin types
  2. 6:56Kotlin singletons and objects
  3. 9:24Any vs Object in Kotlin
  4. 14:26Nothing type explained
  5. 22:47Null safety in Kotlin
  6. 31:22Nullable types compilation
  7. 37:02Safe navigation and Elvis operator
  8. 43:01Type checking in Kotlin
  9. 45:58Smart and safe casting
  10. 50:10Closing remarks
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.