diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala | 6 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 6 |
2 files changed, 5 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala b/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala index efe7519d5e..c8b7fcee8f 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala @@ -77,11 +77,7 @@ abstract class Pickler extends SubComponent { } if (!t.isDef && t.hasSymbolField && t.symbol.isTermMacro) { - unit.error(t.pos, t.symbol.typeParams.length match { - case 0 => "macro has not been expanded" - case 1 => "this type parameter must be specified" - case _ => "these type parameters must be specified" - }) + unit.error(t.pos, "macro has not been expanded") return } } diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index a9e2d479db..b0b1341a07 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -1061,6 +1061,7 @@ trait Typers extends Modes with Adaptations with Tags { instantiateToMethodType(mt) case _ => + def vanillaAdapt(tree: Tree) = { def shouldInsertApply(tree: Tree) = inAllModes(mode, EXPRmode | FUNmode) && (tree.tpe match { case _: MethodType | _: OverloadedType | _: PolyType => false case _ => applyPossible @@ -1076,8 +1077,6 @@ trait Typers extends Modes with Adaptations with Tags { } if (tree.isType) adaptType() - else if (inExprModeButNot(mode, FUNmode) && treeInfo.isMacroApplication(tree)) - macroExpandApply(this, tree, mode, pt) else if (inAllModes(mode, PATTERNmode | FUNmode)) adaptConstrPattern() else if (shouldInsertApply(tree)) @@ -1206,6 +1205,9 @@ trait Typers extends Modes with Adaptations with Tags { } fallBack } + } + val tree1 = if (inExprModeButNot(mode, FUNmode) && treeInfo.isMacroApplication(tree)) macroExpandApply(this, tree, mode, pt) else tree + if (tree == tree1) vanillaAdapt(tree1) else tree1 } } |