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

4 Parameterization and Parametric Polymorphism

4.3 Matching Against Type Patterns

If the type of a method's formal contains a binding occurrence of an implicit type parameter, i.e., a type of the form 'T, then the system is responsible for automatically inferring the right instantiating actual type for each call of the method. Once bound, implicit type parameters are just like explicit type parameters. Matching has two parts: message sends are compared against signatures that may contain implicit type parameters, and method implementations are compared against signatures, either of which may have implicit type parameters. The first case is easier, since it requires matching a regular type against a type pattern, while the second case requires the ability to compare two patterns. Below we describe somewhat informally the process of matching a type against a type pattern; precise descriptions of both processes remain future work.

4.3.1 - Method Formal Type Patterns
4.3.2 - Upper Bound Type Patterns
4.3.3 - The Matching Algorithm
4.3.4 - Static vs. Dynamic Matching
4.3.5 - Constraints on Supertype Graphs for Matching
4.3.6 - Matching and Bounded Formal Type Parameters

The Cecil Language: Specification and Rationale, Version 2.1 - 25 MARCH 1997
[Next] [Previous] [Up] [Top] [Contents] [Index]

Generated with Harlequin WebMaker