4 ms·
As in Scala: // define a type alias type UserId = Long // can be used as a regular type val userId: UserId = 123L val userIds: List[UserId
by uDontKnowMe 6y ago
As in Scala:
// define a type alias
type UserId = Long
// can be used as a regular type
val userId: UserId = 123L
val userIds: List[UserId] = List(1L, 2L, 3L)