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








