https://kotlinlang.org logo
Title
a

Arjan van Wieringen

04/24/2023, 1:32 PM
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) {
 // ....
}
a

Amejonah 1200

04/24/2023, 2:16 PM
Reminds me of Rusts Associated Types