Merge: SharedPreferences: Nit API wrapping android SharedPreferences class
[nit.git] / src / local_var_init.nit
index 0ef4b4a..4ed1ff8 100644 (file)
@@ -20,6 +20,17 @@ module local_var_init
 
 import scope
 import flow
+import phase
+
+redef class ToolContext
+       var local_var_init_phase: Phase = new LocalVarInitPhase(self, [flow_phase])
+end
+
+private class LocalVarInitPhase
+       super Phase
+
+       redef fun process_npropdef(npropdef) do npropdef.do_local_var_init(toolcontext)
+end
 
 redef class APropdef
        # Entry point of the whole local variable initialization verifier
@@ -73,7 +84,7 @@ private class LocalVarInitVisitor
 
        redef fun visit(n)
        do
-               if n != null then n.accept_local_var_visitor(self)
+               n.accept_local_var_visitor(self)
        end
 end