Merge: model: better implementation of the two `intro` methods
authorJean Privat <jean@pryen.org>
Fri, 24 Oct 2014 23:58:26 +0000 (19:58 -0400)
committerJean Privat <jean@pryen.org>
Fri, 24 Oct 2014 23:58:26 +0000 (19:58 -0400)
commitdb8e46c3bf48ad585c7ed4fd79f119f35ca19185
tree6724f1404be716d90f03c6b75d1fac68481f232d
parente1e9193c7e61b0933014b2ecfaadf2fc4368101c
parent154a41350e0e73b95f6395339aeb5ea795f3c9a9
Merge: model: better implementation of the two `intro` methods

MClass and MProperty have a `intro` method to get the introducing
definition.
The initial implementation was to return the first known definition, that
make sense for a model constructed from a source-code where introductions
are read before refinements and redefinitions.

However, for a better robustness of the model that allows to load the
model form a serialized form or allows a model partially loaded, the
first-read definition is not necessary the intro.

This new implementation uses a different approach: the introduction is
the definition in the introducing compound (module for classes and
classdefs for properties). The introducing compound is known since the
construction, thus this new implementation is trivial and does not change
the API.

Rewrite-of: #841

Pull-Request: #843
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>