~/talk

Kotlin Types: Exposed

Talkat KotlinConf 2017 · 2017-11-02..11-03· [kotlin, java]
slides:none on file

Kotlin types compile to specific Java constructs: primitives stay primitives except when used in generics, IntArray exists for primitive arrays, and String maps to java.lang.String; Kotlin uses bytecode/decompile to show these mappings. Kotlin’s Unit compiles to void while Nothing models “never returns”; nullability from Java becomes platform types unless annotated. Best fixes are annotating Java (JSR‑305 like @Nullable/@NotNull) or declaring Kotlin types explicitly. Collections expose read-only vs mutable interfaces but remain Java collections at runtime.

AI-written summary · about

  1. 0:00Intro
  2. 2:35Kotlin Bytecode
  3. 3:10Decompiled Java code
  4. 4:18Primitive & wrapper types
  5. 12:18Unit instead of void
  6. 13:35Nothing is different to Unit/void
  7. 16:33Let's say, fail function returns Unit
  8. 21:38Type hierarchy
  9. 25:18Nullability annotations
  10. 25:51Nullability & Java
  11. 26:54The safest approach would be...
  12. 29:53Platform type in error message
  13. 32:42Different annotations are supported
  14. 33:40Annotate your Java types
  15. 36:50Specify types explicitly
  16. 38:04Intrinsic checks
  17. 39:14Nullable platform types: summary
  18. 43:46Platform type for Java collection
  19. 44:51Read-only interfaces improve API
~/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.