modelbuilder: simplify the call of `add_in_hierarchy`
authorJean Privat <jean@pryen.org>
Thu, 12 Jun 2014 17:06:06 +0000 (13:06 -0400)
committerJean Privat <jean@pryen.org>
Thu, 12 Jun 2014 17:06:06 +0000 (13:06 -0400)
We have all the needed model information, moreover, it is more
robust than using the AST

Signed-off-by: Jean Privat <jean@pryen.org>

src/modelize_class.nit

index 4cd9475..87d28d1 100644 (file)
@@ -281,8 +281,7 @@ redef class ModelBuilder
                if errcount != toolcontext.error_count then return
 
                # Create the mclassdef hierarchy
-               for nclassdef in nmodule.n_classdefs do
-                       var mclassdef = nclassdef.mclassdef.as(not null)
+               for mclassdef in mmodule.mclassdefs do
                        mclassdef.add_in_hierarchy
                end