Mascara Try it Download Buy About Documentation Blog

Parameterized Types

A parameterized type defines one or more type parameters, which can be instantiated at compile time. This is equivalent to what is called generics in Java and C#. Classes and functions can be parameterized.

Example:

class Point.<T> {
  var x: T, y: T;
}
var p = new Point.<double>;
p.x = 3.0;
p.y = 5.0;