miniboxing.plugin.transform.minibox.inject.Duplicators
Fix the given type by replacing invalid symbols with the new ones.
Special typer method for re-type checking trees.
Special typer method for re-type checking trees. It expects a typed tree. Returns a typed tree that has fresh symbols for all definitions in the original tree.
Each definition tree is visited and its symbol added to the invalidSyms map (except LabelDefs), then cleared (forcing the namer to create fresh symbols). All invalid symbols found in trees are cleared (except for LabelDefs), forcing the typechecker to look for fresh ones in the context.
Type trees are typed by substituting old symbols for new ones (@see fixType).
LabelDefs are not typable from trees alone, unless they have the type ()Unit. Therefore, their symbols are recreated ad-hoc and their types are fixed inline, instead of letting the namer/typer handle them, or Idents that refer to them.
A typer that creates new symbols for all definitions in the given tree and updates references to them while re-typechecking. All types in the tree, except for TypeTrees, are erased prior to type checking. TypeTrees are fixed by substituting invalid symbols for the new ones.