model_collect: collect all MClass inherited methods
authorAlexandre Terrasa <alexandre@moz-code.org>
Tue, 19 Apr 2016 01:18:21 +0000 (21:18 -0400)
committerAlexandre Terrasa <alexandre@moz-code.org>
Thu, 21 Apr 2016 21:37:14 +0000 (17:37 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

src/model/model_collect.nit

index c8d3766..c5d4a34 100644 (file)
@@ -268,6 +268,15 @@ redef class MClass
                return set
        end
 
+       # Collect mmethods inherited by 'self' if accepted by `view`.
+       fun collect_inherited_mmethods(view: ModelView): Set[MMethod] do
+               var res = new HashSet[MMethod]
+               for mproperty in collect_inherited_mproperties(view) do
+                       if mproperty isa MMethod then res.add(mproperty)
+               end
+               return res
+       end
+
        # Collect mattributes introduced in 'self' with `visibility >= min_visibility`.
        fun collect_intro_mattributes(view: ModelView): Set[MAttribute] do
                var res = new HashSet[MAttribute]