Revamping and Extending Kotlin’s Type System | Ross Tate

Recording brought to you by American Express. Enjoyed this talk? Experience it live at KotlinConf 2025—the biggest in history! Grab your tickets now: You might be surprised to learn that Kotlin’s type system is undecidable and unsound; we can reliably cause the type-checker to stack-overflow, and we can trick it into thinking a String object is an Int. And that’s before considering type inference or advanced features like platform types. Yet, understandably, developers are always requesting more features, like union and intersection types, and the Kotlin team would like to provide such features, but without jumping off a cliff of unrecoverable complexity. So how can we achieve this? Kotlin is not alone in these issues; in fact, I discovered many of these problems in Java first. Yet, in discovering them, I also recognized how unnatural these problematic programs were. That is, they do not seem to be programs any pragmatic person would actually write. Rather, they represented expressiveness in the language that no one actually seems to need but yet manages to complicate the typing algorithms and even the language design. Recently, the Kotlin team and I started to explore how we might remove the unnecessarily problematic expressiveness—in a way that no practical developer would ever notice—so that we can lay a better foundation for supporting the features the developers actually want. In this session, I will offer a sneak peek into the changes we are exploring: the pragmatic restrictions, the new algorithmic foundations, and the extensions like efficient unions and intersections we hope to add. While this is a long-term project, we hope this session will convey the design strategy we are pursuing, as well as provide an opportunity for developers to share feedback and insights that can help us ensure the improvements serve their needs over the coming years.
Back to Top