Skip to content

Commit

Permalink
fixed module-use jump-to-decl
Browse files Browse the repository at this point in the history
  • Loading branch information
peq committed May 16, 2018
1 parent 2ae275e commit 9dee7fc
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@ public static ModuleInstanciations expandModules(ClassOrModule m, Collection<Cla
typeReplacements.add(Pair.create(usedModule.getTypeParameters().get(i).attrTyp(), moduleUse.getTypeArgs().get(i).attrTyp()));
}

ModuleInstanciation mi = Ast.ModuleInstanciation(moduleUse.getSource(), Ast.Modifiers(),
Ast.Identifier(moduleUse.getModuleNameId().getSource(), usedModule.getName()),
WPos source = moduleUse.getSource().artificial();
WPos idSource = moduleUse.getModuleNameId().getSource().artificial();
ModuleInstanciation mi = Ast.ModuleInstanciation(source, Ast.Modifiers(),
Ast.Identifier(idSource, usedModule.getName()),
smartCopy(usedModule.getInnerClasses(), typeReplacements),
smartCopy(usedModule.getMethods(), typeReplacements),
smartCopy(usedModule.getVars(), typeReplacements),
Expand All @@ -86,7 +88,6 @@ public static ModuleInstanciations expandModules(ClassOrModule m, Collection<Cla

if (mi.getConstructors().isEmpty()) {
// add default constructor:
WPos source = moduleUse.getSource().artificial();
mi.getConstructors().add(Ast.ConstructorDef(
source,
Ast.Modifiers(),
Expand Down

0 comments on commit 9dee7fc

Please sign in to comment.