From 2804c6316e9ad822fa7de45009f0fe4aed67ab7d Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Tue, 11 Apr 2017 10:57:27 -0700 Subject: Revert some of ade53a123. Use completer factory methods. Scalameta et al need to be able to customize the type completer behavior, so we must use factory methods to instantiate them, rather than instantiating the classes directly. --- .../scala/tools/nsc/typechecker/MethodSynthesis.scala | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/compiler/scala/tools/nsc/typechecker/MethodSynthesis.scala') diff --git a/src/compiler/scala/tools/nsc/typechecker/MethodSynthesis.scala b/src/compiler/scala/tools/nsc/typechecker/MethodSynthesis.scala index 72d186b301..fea9debe7e 100644 --- a/src/compiler/scala/tools/nsc/typechecker/MethodSynthesis.scala +++ b/src/compiler/scala/tools/nsc/typechecker/MethodSynthesis.scala @@ -146,8 +146,8 @@ trait MethodSynthesis { // if there's no field symbol, the ValDef tree receives the getter symbol and thus is not a synthetic if (fieldSym != NoSymbol) { context.unit.synthetics(getterSym) = getter.derivedTree(getterSym) - getterSym setInfo new namer.AccessorTypeCompleter(tree, tree.tpt.isEmpty, isBean = false, isSetter = false) - } else getterSym setInfo new namer.ValTypeCompleter(tree) + getterSym setInfo namer.accessorTypeCompleter(tree, tree.tpt.isEmpty, isBean = false, isSetter = false) + } else getterSym setInfo namer.valTypeCompleter(tree) enterInScope(getterSym) @@ -155,17 +155,17 @@ trait MethodSynthesis { val setter = Setter(tree) val setterSym = setter.createSym context.unit.synthetics(setterSym) = setter.derivedTree(setterSym) - setterSym setInfo new namer.AccessorTypeCompleter(tree, tree.tpt.isEmpty, isBean = false, isSetter = true) + setterSym setInfo namer.accessorTypeCompleter(tree, tree.tpt.isEmpty, isBean = false, isSetter = true) enterInScope(setterSym) } // TODO: delay emitting the field to the fields phase (except for private[this] vals, which only get a field and no accessors) if (fieldSym != NoSymbol) { - fieldSym setInfo new namer.ValTypeCompleter(tree) + fieldSym setInfo namer.valTypeCompleter(tree) enterInScope(fieldSym) } } else { - getterSym setInfo new namer.ValTypeCompleter(tree) + getterSym setInfo namer.valTypeCompleter(tree) enterInScope(getterSym) } @@ -208,11 +208,11 @@ trait MethodSynthesis { sym } - val getterCompleter = new namer.AccessorTypeCompleter(tree, missingTpt, isBean = true, isSetter = false) + val getterCompleter = namer.accessorTypeCompleter(tree, missingTpt, isBean = true, isSetter = false) enterInScope(deriveBeanAccessor(if (hasBeanProperty) "get" else "is") setInfo getterCompleter) if (tree.mods.isMutable) { - val setterCompleter = new namer.AccessorTypeCompleter(tree, missingTpt, isBean = true, isSetter = true) + val setterCompleter = namer.accessorTypeCompleter(tree, missingTpt, isBean = true, isSetter = true) enterInScope(deriveBeanAccessor("set") setInfo setterCompleter) } } -- cgit v1.2.3