Fuzion Logo
fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.

Type Features

Fuzion has a mechanism to define features on cotypes. This is similar but more powerful than static methods in e.g. Java.

See this example on how to define and call a type feature.

Type features are inherited just like normal features and can also be redefined.

You can also call type features via a - constrainted - type parameter.

property.equatable.type.equality is a type feature in property.equatable.

property.equatable is
  type.equality(a, b equatable.this) bool => abstract

and here it is called via constrainted type parameter T

equals(T type : property.equatable, a, b T) bool => T.equality a b

We can define a new feature that redefines type.equality and it will then be possible to call equals with instances of those features.

Lastly we can also call type features on this-types. feat1.this.type is the target of the call for feat_name. In feat2 which inherits from feat1 feat1.this is then automatically replaced by feat2.this.

last changed: 2026-07-03