I guess you could make interfaces for every field ...
# android-architecture
t
I guess you could make interfaces for every field of the
User
and then simulate structural typing by parameterizing your methods and constraining them to a union of the interfaces:
Copy code
interface UserId { val id: Int }
interface UserName { name: String }
fun <T> foo(user: T) where T : UserId, T : UserName {}
But this is hardly scalable