diff options
author | Paul Phillips <paulp@improving.org> | 2013-05-16 22:30:24 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2013-05-16 22:34:16 -0700 |
commit | 0c3ca2248d55eeeee2db6693e5fc46b9ba049eda (patch) | |
tree | 71686d0b99fc1d4a245ddb24efe50398b0c00c78 /src/compiler/scala/tools/nsc/typechecker/Typers.scala | |
parent | c663ecf8677eda3fe8c91170b614eb7166b18711 (diff) | |
parent | 13b4628aabb8e7a293a382dcab6db5848f672f94 (diff) | |
download | scala-0c3ca2248d55eeeee2db6693e5fc46b9ba049eda.tar.gz scala-0c3ca2248d55eeeee2db6693e5fc46b9ba049eda.tar.bz2 scala-0c3ca2248d55eeeee2db6693e5fc46b9ba049eda.zip |
Merge branch 'master' into HEAD
* master:
SI-7469 Remove @deprecated scala.util.logging
SI-3943 Test case for already-fixed Java interop bug
Fix formatting for couple of docs in the compiler
SI-7476 Add documentation to GenericTraversableTemplate
SI-7469 Remove @deprecated scala.util.parsing.ast
SI-7469 Remove @deprecated MurmurHash elements
SI-7469 Remove deprecated elements in s.u.parsing.combinator
SI-7469 Make @deprecated elems in scala.concurrent private[scala]
removes duplication in inferImplicitValue
SI-7047 fixes silent for c.inferImplicitXXX
SI-7167 implicit macros decide what is divergence
macroExpandAll is now triggered in all invocations of typed
SI-5923 instantiates targs in deferred macro applications
SI-6406 Restore deprecated API
SI-6039 Harden against irrelevant filesystem details
Limit unnecessary calls to Type#toString.
fix typo in comment
SI-7432 add testcases
SI-7432 Range.min should throw NoSuchElementException on empty range
AbstractFile.getDirectory does not return null when outDir is "."
Conflicts:
src/compiler/scala/tools/nsc/typechecker/Typers.scala
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 5cce4865cc..5b1f7160b7 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -1233,29 +1233,21 @@ trait Typers extends Adaptations with Tags { } if (tree.isType) adaptType() + else if (mode.typingExprNotFun && treeInfo.isMacroApplication(tree)) + macroExpandApply(this, tree, mode, pt) else if (mode.typingPatternFun) adaptConstrPattern() else if (shouldInsertApply(tree)) insertApply() else if (hasUndetsInMonoMode) { // (9) assert(!context.inTypeConstructor, context) //@M - if (mode.typingExprNotFun && pt.typeSymbol == UnitClass) - instantiateExpectingUnit(tree, mode) - else - instantiate(tree, mode, pt) + instantiatePossiblyExpectingUnit(tree, mode, pt) } else if (tree.tpe <:< pt) tree else fallbackAfterVanillaAdapt() } - def expandMacroAndVanillaAdapt(): Tree = { - if (mode.typingExprNotFun && treeInfo.isMacroApplication(tree)) { - val tree1 = macroExpandApply(this, tree, mode, pt) - if (tree == tree1) vanillaAdapt(tree) else tree1 - } - else vanillaAdapt(tree) - } // begin adapt tree.tpe match { @@ -1294,7 +1286,7 @@ trait Typers extends Adaptations with Tags { case mt: MethodType if mode.typingExprNotFunNotLhs && !hasUndetsInMonoMode && !treeInfo.isMacroApplicationOrBlock(tree) => instantiateToMethodType(mt) case _ => - expandMacroAndVanillaAdapt() + vanillaAdapt(tree) } } @@ -1315,6 +1307,13 @@ trait Typers extends Adaptations with Tags { } } + def instantiatePossiblyExpectingUnit(tree: Tree, mode: Mode, pt: Type): Tree = { + if (mode.typingExprNotFun && pt.typeSymbol == UnitClass) + instantiateExpectingUnit(tree, mode) + else + instantiate(tree, mode, pt) + } + private def isAdaptableWithView(qual: Tree) = { val qtpe = qual.tpe.widen ( !isPastTyper |