Generics

From The Oxygene Language Wiki

Jump to:navigation, search

This is a Language topic
Feel free to add your notes to this topic below.



A generic type or method is a method or type with 1 or more type parameters.

A type parameter is a new type, defined within the scope of the method or type, which is still undefined at that point. A type parameter or generic parameter can be used all through the class it's defined in, or, in case of a method, all through the method.

Generic parameters can be constrained to have some characteristics, see Generic Constraints.

On the calling side, the method or class with the generic parameter is treated like it had a parameter defined with the type passed as parameter, so if a string is used in the parameter, and a member or result uses that generic parameter, it's treated like it's a string on the calling side.


See Also


Oxygene-48.png

Area: Oxygene Language
Compiler version: Oxygene 5

Language GlossaryKeywordsTypesFAQHow To

Navigation
Areas
More
Toolbox