Previous Table of Contents Next


3.8.4 Forward Declaration


   A forward declaration declares the name of an interface without defining it. This permits the definition of interfaces that refer to each other. The syntax is: optionally either the keyword abstract or the keyword local, followed by the keyword interface, followed by an <identifier> that names the interface.

   Multiple forward declarations of the same interface name are legal.

   It is illegal to inherit from a forward-declared interface whose definition has not yet

been seen:

module Example { interface base;

};

// Forward declaration
// ...
interface derived : baseinterface base {}; interface derived : base {}; // Error // Define base {}; // OK