From 3081712431733daebc2052c8e071c241dac2bc32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Br=C3=A1ulio=20Bezerra?= Date: Thu, 30 Nov 2017 00:54:35 -0300 Subject: [PATCH] Type alias grammar --- src/items/type-aliases.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/items/type-aliases.md b/src/items/type-aliases.md index 532254372..460d55f03 100644 --- a/src/items/type-aliases.md +++ b/src/items/type-aliases.md @@ -1,5 +1,10 @@ # Type aliases +> **Syntax** +> _TypeAlias_ : +>    `type` [IDENTIFIER] [_Generics_]? +> [_WhereClause_]? `=` [_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 @@ -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