~/talk

New Type Inference and Related Language Features

Talkat KotlinConf 2018 · 2018-10-03..10-05· [kotlin]
slides:none on file

Kotlin 1.3 exposes experimental features: an explicit contract DSL lets library functions declare effects (like “calls lambda exactly once” or “isNullOrEmpty() → receiver != null”) so the compiler applies smart casts; a rewritten new type inference engine (opt‑in) infers SAM lambdas from Java, improves builder/sequence inference (yield/buildSequence), analyzes whole call chains, and recognizes internal intersection type T!! = T & Any to treat checked-generic non‑nulls correctly. Migration checks and opt‑ins are provided.

AI-written summary · about

  1. 0:00Intro
  2. 1:09Experimental features
  3. 1:52Example: Coroutines
  4. 2:26Automatic migration
  5. 2:53Experimental Language Features
  6. 5:21Using experimental API
  7. 6:05Experimental: Summary
  8. 7:04Changes in standard library
  9. 9:46Kotlin Contracts
  10. 12:08Contract: if the function returns false, the receiver is not null
  11. 16:08Why can't compiler just implicitly infer such information?
  12. 17:34Using contracts for your own functions
  13. 18:40Contracts: Summary
  14. 22:00Kotlin libraries
  15. 24:50SAM conversions for Kotlin functions
  16. 26:02Support for several SAM arguments
  17. 28:09Inference for sequence
  18. 28:59Inference for regular lambdas
  19. 29:45Inference for builder lambdas
  20. 30:17Builder inference
  21. 32:30Inference for call chains
  22. 34:06Better inference for intersection types
  23. 36:55Intersection type to denote not-nullable generic type
  24. 39:01Improving assertNotNull: return asserted value
  25. 40:43New type inference: summary
~/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.