-
-
Notifications
You must be signed in to change notification settings - Fork 9
Type Aliases
IsaacShelton edited this page Mar 21, 2022
·
1 revision
Type aliases can be declared using the alias
keyword with a name followed by an =
, and a type.
alias MyTypeAlias = Type
Type aliases are substituted out before any type checking is done. A consequence of this, is that type aliases are treated exactly the same as regular types
import basics
alias s64 = long
func sum(a, b long) long = a + b
func main {
a s64 = 8
b s64 = 13
print(sum(a, b))
}