Type aliases
suggest changeIntroduction
With type aliases, we can give an alias to another type. They are useful for naming function types such as (String) -> Boolean, or generic types such as Pair<Person, Person>.
Type aliases support generics. An alias can replace a generic type, and an alias can itself be generic.
Syntax
- typealias alias-name = existing-type
Remarks
Type aliases are a compiler feature. Nothing is added to the generated JVM code. Every alias is replaced by the real type.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents