Type aliasing
Type aliasing is a feature in some programming languages that allows creating a reference to a type using another name. It does not create a new type hence does not increase type safety. It can be used to shorten a long name. Languages allowing type aliasing include: C++, C# Crystal, D, Dart, Elixir, Elm, F#, Go, Hack, Haskell, Julia, Kotlin, Nim, OCaml, Python, Rust, Scala, Swift and TypeScript.
Type aliasing is a feature in some programming languages that allows creating a reference to a type using another name. It does not create a new type hence does not increase type safety. It can be used to shorten a long name. Languages allowing type aliasing include: C++, C# Crystal, D, Dart, Elixir, Elm, F#, Go, Hack, Haskell, Julia, Kotlin, Nim, OCaml, Python, Rust, Scala, Swift and TypeScript. using Distance = int; using Distance = int; alias Distance = Int32; alias Distance = int; typedef Distance = int; @type Distance :: integer type alias Distance = Int type Distance = int Go features type aliasing using the type keyword and = . type Distance = int newtype Distance = int; type Distance = Int; const Distance = Int typealias Distance = Int type Distance* = int type distance = int Vector = list[float] Type aliases may be marked with TypeAlias to make it explicit that the statement is a type alias declaration, not a normal variable assignment. The use of (from PEP 613) is not required for the alias to function, but it explicitly tells static type checkers (like Mypy) that the assignment is a type declaration, not a runtime variable assignment. from typing import TypeAlias Vector: TypeAlias = list[float] type Point = (u8, u8); object Logarithms: opaque type Logarithm = Double typealias Distance = Int; type Distance = number; const distance = u32;
References
No reference rows published for this article.
Cite this article
MLA
"Type aliasing." encyclopegia.org, 2026, https://encyclopegia.org/wiki/type-aliasing. Accessed 24 November 2026.
Chicago
"Type aliasing." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/type-aliasing.
APA
encyclopegia.org. (2026). Type aliasing. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/type-aliasing
Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON