Mapped Types

Mapped types are a unique feature of the Elements compiler. They let you create compatibility wrappers for types without ending up with classes that contain the real type. The wrappers will be eliminated by the compiler and rewritten to use the type the mapping maps to.

When working with Java, you will most commonly use mapped types (for example as provided by the Sugar cross-platform library). Using mapped types is seamless, and they behave just like regular non-mapped types.

You will not often need to implement mapped types yourself, but for when you do, RemObjects Iodine – like Oxygene, C# and Swift – provides a syntax for implementing mapped types when needed, with the __mapped keyword and the => operator.

Please refer to the Mapped Types topic in the Language Concepts section for more details.