~/talk

Kotlin Generics In Depth

Talkat droidcon San Francisco 2022 · 2022-06-02..06-03· [kotlin]
links:none on file
slides:none on file

Covers how Kotlin enforces in/out variance (why mutable List<String> ≠ MutableList<Any>), demonstrates use-site variance and star projection with concrete examples, shows how upper bounds let a star projection carry duck-specific methods, and explains reified type parameters via inline functions so emptyList<Duck>() can be distinguished at runtime. Includes practical notes: unsafeVariance in immutable collections, extension functions for constrained generics, and Jackson Kotlin module deserialization use cases.

AI-written summary · about

  1. 0:00Introduction
  2. 1:08What are generics
  3. 3:36Understanding variance
  4. 10:17Variance annotations
  5. 14:12Type projection explained
  6. 19:26Type constraints and bounds
  7. 24:15Reification in Kotlin
  8. 28:29Q&A and resources
~/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.