Skip to content

utils: fix failure to generate link to error domain

The gir.ast.Enumeration class is inherited by gir.ast.ErrorDomain class, therefore isinstance(t, Enumeration) matches to both enumeration and error domain type. This causes failure to link for error domain.

WARNING: Invalid fragment for 'GLib.FileError': it should be enum
[error@GLib.FileError].
^~~~~~~~~~~~~~~~~~~~~

The Enumeration class is inherited by gir.ast.BitField class as well, however it doesn't matter since the evaluation priority to bitfield is higher than enumeration. Nevertheless, it might have potential weak to future change (e.g. reorder the branches carelessly).

This commit fixes the bug to match Enumeration at first, then judge bitfield/error-domain/enumeration by detecting these classes.

Merge request reports