next up previous contents
Next: Basic Symbols Up: ValuesObjects, Classes and Previous: Types and Classes

Type Conformance

  The type dependence graph TDG of a program is an (acyclic) graph whose nodes are the class types occurring in the program. There are two kinds of arrows in TDG: tex2html_wrap_inline1709 indicates that T' is a type conforming to T. tex2html_wrap_inline1715 indicates that T' structurally conforms to T but is not necessarily a subtype of or conformes to T', i.e. the subtype inheritance clause may be missing but otherwise the same requirements are fulfilled.

The precise definition of subtyping, conformance, and structural conformance is recursive:

A class type T' structurally conforms to a class type T if

A class type T' conforms to a class type T if

A class type T' is a subtype of a class type T if

  1. T' structurally conforms to T, and
  2. T' contains an inheritance clause like T.
Any class type T is (automatically) a subtype of a polymorphic type tex2html_wrap_inline1771 , cf. 8.1.

A method f conforms to a method g if

A method type T' conforms to a method type T if any method of type T' conforms to a method of type T provided they have the same name.

A stream object type conforms to another one if the stream types from which these objects are established conform.

A method f conflicts with a method g if

Note: The notion of conflict is used in overloading resolution, cf. 5.1. If method g conforms to method f then it also conflicts with f; the converse is not always true. tex2html_wrap_inline1707

These definitions are also applicable to the methods generated from attribute declarations within classes, cf. 4.5.


next up previous contents
Next: Basic Symbols Up: ValuesObjects, Classes and Previous: Types and Classes

Martin Trapp
Mon Feb 17 16:49:16 MET 1997