Skip to content

Commit

Permalink
Merge pull request #163 from brauliobz/grammar_type_alias
Browse files Browse the repository at this point in the history
Type alias grammar
  • Loading branch information
Havvy authored Dec 1, 2017
2 parents ca1d926 + 3081712 commit c5ef18c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/items/type-aliases.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Type aliases

> **<sup>Syntax</sup>**
> _TypeAlias_ :
> &nbsp;&nbsp; `type` [IDENTIFIER]&nbsp;[_Generics_]<sup>?</sup>
> [_WhereClause_]<sup>?</sup> `=` [_Type_] `;`
A _type alias_ defines a new name for an existing [type]. Type aliases are
declared with the keyword `type`. Every value has a single, specific type, but
may implement several different traits, or be compatible with several different
Expand All @@ -23,3 +28,8 @@ type F = E;
let _: F = E::A; // OK
// let _: F = F::A; // Doesn't work
```

[IDENTIFIER]: identifiers.html
[_Generics_]: items.html#type-parameters
[_WhereClause_]: items.html#type-parameters
[_Type_]: types.html

0 comments on commit c5ef18c

Please sign in to comment.