Skip to content
Snippets Groups Projects
Commit 03a84ffc authored by Emmanouil (Manos) Koukoutos's avatar Emmanouil (Manos) Koukoutos
Browse files

Imports show to fresh Modules after RestoreMethods

parent 7c34f26f
No related branches found
No related tags found
No related merge requests found
...@@ -120,12 +120,16 @@ object RestoreMethods extends TransformationPhase { ...@@ -120,12 +120,16 @@ object RestoreMethods extends TransformationPhase {
} }
m.copy(defs = m.definedClasses ++ newFuns).copiedFrom(m) m.copy(defs = m.definedClasses ++ newFuns).copiedFrom(m)
} }
val modsToMods = ( for { u <- p.units; m <- u.modules } yield (m,refreshModule(m)) ).toMap
p.copy(units = p.units map { u => u.copy( p.copy(units = p.units map { u => u.copy(
modules = u.modules map refreshModule, modules = u.modules map modsToMods,
imports = u.imports flatMap { imports = u.imports flatMap {
// Don't include imports for functions that became methods // Don't include imports for functions that became methods
case WildcardImport(fd : FunDef) if oldFuns contains fd => None case SingleImport(fd : FunDef) if oldFuns contains fd => None
case SingleImport(m : ModuleDef) => Some(SingleImport(modsToMods(m)))
case WildcardImport(m : ModuleDef) => Some(WildcardImport(modsToMods(m)))
case other => Some(other) case other => Some(other)
} }
)}) )})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment