A type system employing structural subtyping is disclosed herein. A core
type system supports several structural types, such as stream, choice,
intersection and sequence. Also part of the core type system is a new
invariant type, which denotes values whose dynamic type is the same as
its static type, and type restrictions for limiting a range of a base
type. Furthermore, a streamlined structural version of delegates, called
structural delegates and a validation method thereof are introduce into
the type system. To further facilitate type safety, strict statically
checked interface casts are introduced.