Will Kotlin support some form of structural typing...
# language-evolution
v
Will Kotlin support some form of structural typing on top of its nominal typing? I recently did a lot of Typescript programming, and found its structural typing very versatile and suitable for data-intensive business applications.
y
I find that unlikely to happen. However, I can easily see some approximation of that being possible if denotable intersection types are added to the language. Imagine interfaces like
interface HasFooString { foo: String }
etc, then you simply compose them together with an intersection type. Btw, there's some semblance of structural typing in Kotlin DataFrame, which might likely fit your needs. It uses a compiler plugin to achieve that, but it's a first-party library, so it should stay supported