While implementing GSVG, I had to add
DomDocumentType to a
DomDocument, so your renderer will recognize it is a SVG document, so I use following:
class GomNode : DomNode
class GomDocumentType : GomNode, DomNode
GomNode is implementing
DomNode, so yo don’t need to add that interface in its derived classes
Hours after a set of debugs, I found you should don’t do that, because it produce a infinite cycle, leading to a crash.
GomDocumentType should be:
class GomDocumentType : GomNode
GomDocumentType is a
3 thoughts on “Vala Tip: Don’t add an already implemented interface to a derived class”
This sounds like a bug in Vala.
At the end, it is. Unlike C/GObject, Vala rise errors on unimplemented methods or interfaces declared as prerequisites. This is a programming error and the compiler could help, by detecting if the classes, the new class derives from, have implemented an interface to rise an error.
I’ve filed a bug report at: https://bugzilla.gnome.org/show_bug.cgi?id=789443