[Next] [Previous] [Up] [Top] [Contents] [Index]

3.3 Type and Signature Declarations

3.3.1 Type Declarations

New user-defined types are introduced with type declarations of the following form (ignoring parameterization and encapsulation aspects):

tp_decl 	::=	"type" name {type_relation} ";"
type_relation	::=	"subtypes" types
types	::=	type { "," type }

The new type is considered to be a subtype of each of the types listed in the subtypes clause. The induced subtype relation over used-defined types must be a partial order (i.e., it cannot contain cycles).[11]

Type names are interpreted in a name space distinct from that of objects and variables and that of message names. A type, an object, and a method may all be named list unambiguously.


[11] It is not strictly necessary to restrict subtyping to a partial order. Cycles in the subtypes relation could be allowed, producing a preorder over types instead of a partial order. This would have any type in a cycle being a subtype of and therefore substitutable for every other type in the cycle. In essense, all types in a cycle would be equivalent as far as the type checker was concerned.