Just a wild idea, but would something like Indexed Access Types
https://www.typescriptlang.org/docs/handbook/2/indexed-access-types.html be possible in Kotlin in the future? Or is there some severely limiting architectural aspect?
I use it in Typescript quite a lot and it makes some things quite easy. For instance, when making this in pseudo-Kotlin code:
interface User {
id: UUID
name: String
}
// here User.id = UUID
fun findUserById(id: User.id) {
// ....
}