Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

型 Type

<type-representation>

::= Void
| Int
| Uint
| Float
| Bool
| Char (検討中)
| String
| <qualified-identifier> <type-generics-argument-list>?
| <type-representation> [ ]
| <type-representation> ?
| ( <type-representation> ! <type-representation> )
| ( (<type-representation> ,)* <type-representation>? ) -> <type-representation>

<type-generics-argument-list>

::= [ (<type-representation> ,)* <type-representation>? ]

<type-generics-argument-declaration>

::= [ (<identifier> (: <type-representation>)? ,)* <identifier> (“:” <type-representation>)? ]

型ジェネリクスの型引数宣言。型の定義や関数の定義で使用され、汎用な型について適用可能にする(パラメトリック多相)。

各型引数について、(trait? interface?)の制約を満たす必要を:以降に示せる。