New Language Features in Kotlin 1.4
summary
Covers concrete, usable changes: SAM conversions for Kotlin classes via the new fun interface keyword, explicit API mode that forces visibility and return types for library modules, and a new type inference algorithm that fixes about 300 issues so more code compiles without casts. Also details like trailing commas, mixing named and positional args, unified NullPointerException, and experimental JVM default method modes—implementation changes and backward‑compat options are explained, not just promises.
AI-written summary · about
chapters (25)
- 0:00Intro
- 0:22Kotlin 1.4 Language Features
- 0:54SAM conversions for Kotlin interfaces
- 1:20SAM conversion for a Java interface Java
- 1:35SAM conversion for a Kotlin interface
- 2:40Why functional interfaces?
- 3:42Explicit API mode
- 4:00Specify member visibility
- 6:11Strict mode: reports errors
- 6:37Trailing comma
- 6:47Argument list
- 7:37Function declaration
- 7:50Class declaration
- 8:22Workaround: using labels
- 8:54Mixing named and positional arguments
- 9:27Kotlin 1.3: mixing not allowed
- 9:50New Type Inference
- 11:21Kotlin 1.3: lambda's last expression
- 11:45References to functions with default argument values
- 12:57Unified exception type for null checks
- 13:45The message remains the same
- 14:31This makes future optimizations possible
- 15:45Generating default methods in interfaces (experimental)
- 19:19New modes
- 19:47What's New in 1.4 documentation page What's New in Kotlin 1.4.0
related talks
42mNew Type Inference and Related Language Features
01h 12mKotlin Compiler: Past, 1.4 and Beyond
38mKotlin Language Features in 2.0 and Beyond
26mFacts You May Not Know About Kotlin
43mKotlin 4 vs. Scala 3
42mDissecting Kotlin: Unsealing the Sealed, the SAM, and Other Syntax
44mAdvanced Kotlin
53mKotlin for the curious
