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

Interface definition

Syntax

Interfaces may nest inside classes; outside of classes, interfaces are only allowed in package blocks and top-level region. When inside a class block, contributes a static property.

The interface block must only contain function definitions, which may only contain certain annotations: meta-data and the generic and meta attributes.

    InterfaceDefinition :
      interface IdentifierName TypeParametersopt ExtendsList Block

Interface inheritance

Syntax

    ExtendsList :
      «empty»
      extends TypeExpressionList