model: fix bug where order of classes produces buggy models
The problem was a caching of a non-final information.
collect_things visit the mclassdefs of the module but they may not all
be analyzed (ie. their super-types not all identified)
To solve this we build the model in one more pass:
- a pass to assign the super-types to each mclassdef
- a pass to build the mclassdef hierarchy
a test file is added to prevent regressions.
Reported-by: Alexis Laferrière <alexis.laf@xymus.net>
Signed-off-by: Jean Privat <jean@pryen.org>