From: Jean Privat Date: Wed, 30 Jul 2014 17:30:56 +0000 (-0400) Subject: modelbuilder: TODO, check for useless importation X-Git-Tag: v0.6.7~5^2~1 X-Git-Url: http://nitlanguage.org modelbuilder: TODO, check for useless importation A stub, useless for anybody except by those who understand what this does and who are willing to dig into a bunch of false positive. Signed-off-by: Jean Privat --- diff --git a/src/modelbuilder.nit b/src/modelbuilder.nit index 724d79f..cebbe1b 100644 --- a/src/modelbuilder.nit +++ b/src/modelbuilder.nit @@ -689,6 +689,18 @@ class ModelBuilder end self.toolcontext.info("{mmodule} imports {imported_modules.join(", ")}", 3) mmodule.set_imported_mmodules(imported_modules) + + # TODO: Correctly check for useless importation + # It is even doable? + var directs = mmodule.in_importation.direct_greaters + for nim in nmodule.n_imports do + if not nim isa AStdImport then continue + var im = nim.mmodule + if im == null then continue + if directs.has(im) then continue + # This generates so much noise that it is simpler to just comment it + #warning(nim, "Warning: possible useless importation of {im}") + end end # All the loaded modules