Trait Statement

Defines a trait, a means of describing how a class behaves.

Syntax

[ Abstract ] Trait name [ < typeList > ] [ Does trait ]...
    [ Where genericConstraints  ...]
    [ statements ]
End Trait

Parts

Abstract
Optional
name
Required identifier
typeList
Optional. One or more type parameters, each separated by commas, all enclosed by angle brackets. See Type List for more information.
Does
Optional, repeatable
Where
Optional, repeatable — See Where Clause (Generics) for more information.
statements
Optional
End Trait
Terminates the Trait block.

Remarks

Examples

See also