Generics has recently been adopted to many mainstream object oriented languages,such as C# and Java. As a particular design choice, generics in C# and Javause a sub-typing relation to constraint type parameters. Failing to encapsulate typeparameters within generic interfaces and inability to encapsulate type constraints aspart of an interface definition have been identified as deficiencies in the way this designchoice has been implemented in these languages. These deficiencies can lead toverbose and redundant code. In particular, they have been reported to affect thedevelopment of highly generic libraries. To address these issues, extending objectoriented interfaces and sub-typing with associated types and constraint propagationhas been proposed and studied in an idealized small-scale formal setting. This thesisbuilds on this previous work and provides a design and implementation of theextensions in full C#. We also present a proof of soundness of the FeatherweightGeneric Java (FGJ) formalism extended with interfaces. This property was assumedin a proof of type safety of associated types and constraint propagation, but no prooffor the property was provided.
展开▼