logs: fix logging feature, was crashing because of missing visibility tests
authorJean-Sebastien Gelinas <calestar@gmail.com>
Fri, 7 Jan 2011 19:18:11 +0000 (14:18 -0500)
committerJean-Sebastien Gelinas <calestar@gmail.com>
Fri, 21 Jan 2011 19:44:18 +0000 (14:44 -0500)
Signed-off-by: Jean-Sebastien Gelinas <calestar@gmail.com>

src/abstracttool.nit

index 350d231..d1a53bf 100644 (file)
@@ -116,9 +116,15 @@ redef class MMLocalClass
        fun dump_properties(file: OStream)
        do
                file.write("class {self}\n")
-               for p in global_properties do
-                       var lp = self[p]
-                       file.write("\t{lp}{lp.signature_for(get_type)}\n")
+               if global.visibility_level == 3 and not self == global.intro then
+                       file.write("\tclass not visible in this module\n")
+               else if module.visibility_for(global.module) == 0 then
+                       file.write("\tclass is defined later in the hierarchy\n")
+               else
+                       for p in global_properties do
+                               var lp = self[p]
+                               file.write("\t{lp}{lp.signature_for(get_type)}\n")
+                       end
                end
                file.write("end # {self}\n")
        end