Skip to content

OOP: classes inheritance in reverse order

Types in TTCN-3 can be declared in any order. A structured type can be declared before any of its field types or its element type. The same does not work for classes and their superclasses and supertraits. Declaring a subclass before its superclass or its supertraits causes a C++ compilation error in the generated code.

For example:

type class C2 extends C1 {
  public var charstring @property p2;
}

type class C1 {
  private var integer v;
  public var integer @property p;
  public function f(in integer x) return integer { return x; }
}

/cc @aknappqwt @mmagyari