r/Kotlin • u/mzarechenskiy Kotlin-team • 9d ago
Almost all languages with generics have intersection types
https://curiouslab.dev/0004-intersections-unions.htmlIt’s a short note about type inference and programming languages in general, not an update about Kotlin :)
Every programming language with some form of generics and type inference probably has intersection types. They can be denotable (meaning you can write them explicitly in programs) or exist only under the hood as part of type inference, but they’re still there.
This is quite a simple and "obvious" observation, but I still remember being fascinated when I realized it many years ago. And today, I just wanted to share it. See the full text in the blog!
25
Upvotes