Trait Statement

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

Syntax

[ [Abstract] ] Trait name [ < type_list > ] [ Does trait ]...
    [ Where generic_constraints  ...]
    [ statements ]
End [ Trait ]

Parts

Abstract
Optional – The trait contains only signatures of procedures, not executable statements or variables.
name
Necessary name for the trait
type_list
Optional. One or more type parameters, with a comma between each, all between angle brackets. See Type List for more information.
Does
Optional, repeatable
Where
Optional, repeatable – See Where Clause (Generics) for more information.
statements
Optional
End
Completes the statement. You can also use End Trait.

Instructions

Examples

See also