Cecil supports a static type system which is layered on top of the dynamically-typed core language. The type system's chief characteristics are the following:
- Type declarations specify the interface required of an object stored in a variable or returned from a method, without placing any constraints on its representation or implementation.
- Argument specializers for method dispatching are separate from type declarations, enabling the type system to contain as special cases type systems for traditional single-dispatching and non-object-oriented languages.
- Code inheritance can be distinct from subtyping, but the common case where the two are parallel requires only one set of declarations.
- The type checker can detect statically when a message might be ambiguously defined as a result of multiple inheritance or multiple dispatching. It does not rely on the absence of ambiguities to be correct.
- The type system can check programs statically despite Cecil's classless object model.
- Type declarations are optional, providing partial language support for mixed exploratory and production programming.
- Parameterized objects, types, and methods support flexible forms of parametric polymorphism, complementing the inclusion polymorphism supported through subtyping.
This section describes Cecil's static type system in the absence of parameterization; section 4 extends this section to cope with parameterized objects and methods. Section 3.1 presents the major goals for the type system. Section 3.2 presents the overall structure of the type system. Sections 3.3, 3.4, and 3.5 describe the important kinds of declarations provided by programmers that extend the base dynamically-typed core language described in section 2. Sections 3.6, 3.7, 3.8, and 3.9 detail the type-checking rules for the language. Section 3.10 describes how the language supports mixed statically- and dynamically-typed code.