model: fix bug where order of classes produces buggy models
authorJean Privat <jean@pryen.org>
Tue, 6 Nov 2012 04:47:58 +0000 (23:47 -0500)
committerJean Privat <jean@pryen.org>
Tue, 6 Nov 2012 04:47:58 +0000 (23:47 -0500)
commit66dd306fc76da2cd974da362db6046bba7429042
tree679e5f6c2b3f140f4bea4db9a9a01730f75f72e1
parentc125bcd7461c06bed4140d3b645fad7d2fd0d950
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>
src/model/model.nit
src/modelbuilder.nit
tests/bug_inv_special.nit [new file with mode: 0644]
tests/sav/bug_inv_special.res [new file with mode: 0644]