diff options
author | Paul Phillips <paulp@improving.org> | 2012-11-23 19:59:31 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-11-23 19:59:31 -0800 |
commit | faa6cfcf404b4d172f20b3ed01ba3bd59427b700 (patch) | |
tree | 2206b8defd7c433a2ef1dee3bd1b3f219d60949e /src/compiler/scala/tools | |
parent | 5b498a2612f967c944fa1ed4f63a09d6acc41791 (diff) | |
parent | 57b91c5ee794cb8b66e298594a95a3fc829171f6 (diff) | |
download | scala-faa6cfcf404b4d172f20b3ed01ba3bd59427b700.tar.gz scala-faa6cfcf404b4d172f20b3ed01ba3bd59427b700.tar.bz2 scala-faa6cfcf404b4d172f20b3ed01ba3bd59427b700.zip |
Merge remote-tracking branch 'origin/2.10.0-wip' into merge-2.10.wip-x
# By Jason Zaugg (8) and others
# Via Adriaan Moors (6) and Josh Suereth (5)
* origin/2.10.0-wip:
Removing controversial `either` method from Futures API.
SI-6624 set info of case pattern binder to help find case field accessors
Fixes SI-6628, Revert "Fix for view isEmpty."
SI-6661 - Remove obsolete implicit parameter of scala.concurrent.promise method
Fixes SI-6559 - StringContext not using passed in escape function.
SI-6648 copyAttrs must preserve TypeTree#wasEmpty
Fix raw string interpolator: string parts which were after the first argument were still escaped
Update comment.
SI-6646 `ident` or Ident is always new binding.
SI-6440 Address regressions around MissingRequirementError
Refine the message and triggering of MissingRequirementError.
SI-6640 Better reporting of deficient classpaths.
SI-6644 Account for varargs in extmethod forwarder
SI-6646 Fix regression in for desugaring.
Update tools/epfl-publish
Diffstat (limited to 'src/compiler/scala/tools')
4 files changed, 22 insertions, 8 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala b/src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala index 0d13623e0c..0ac46a18bc 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala @@ -285,7 +285,7 @@ abstract class TreeBuilder { def makeGenerator(pos: Position, pat: Tree, valeq: Boolean, rhs: Tree): Enumerator = { val pat1 = patvarTransformer.transform(pat) val rhs1 = - if (valeq || treeInfo.isVariablePattern(pat)) rhs + if (valeq || treeInfo.isVarPatternDeep(pat)) rhs else makeFilter(rhs, pat1.duplicate, nme.CHECK_IF_REFUTABLE_STRING) if (valeq) ValEq(pos, pat1, rhs1) diff --git a/src/compiler/scala/tools/nsc/reporters/Reporter.scala b/src/compiler/scala/tools/nsc/reporters/Reporter.scala index c5321dd728..8871ae6555 100644 --- a/src/compiler/scala/tools/nsc/reporters/Reporter.scala +++ b/src/compiler/scala/tools/nsc/reporters/Reporter.scala @@ -20,9 +20,15 @@ abstract class Reporter { class Severity(val id: Int) extends severity.Value { var count: Int = 0 } - val INFO = new Severity(0) - val WARNING = new Severity(1) - val ERROR = new Severity(2) + val INFO = new Severity(0) { + override def toString: String = "INFO" + } + val WARNING = new Severity(1) { + override def toString: String = "WARNING" + } + val ERROR = new Severity(2) { + override def toString: String = "ERROR" + } /** Whether very long lines can be truncated. This exists so important * debugging information (like printing the classpath) is not rendered diff --git a/src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala b/src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala index 6cc957a9eb..6f3d7932a5 100644 --- a/src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala +++ b/src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala @@ -173,9 +173,7 @@ abstract class ExtensionMethods extends Transform with TypingTransformers { List(This(currentOwner))) val extensionCall = atOwner(origMeth) { localTyper.typedPos(rhs.pos) { - (extensionCallPrefix /: vparamss) { - case (fn, params) => Apply(fn, params map (param => Ident(param.symbol))) - } + gen.mkForwarder(extensionCallPrefix, mmap(vparamss)(_.symbol)) } } deriveDefDef(tree)(_ => extensionCall) diff --git a/src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala b/src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala index 31db042942..2b6b82f0ab 100644 --- a/src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala +++ b/src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala @@ -417,7 +417,17 @@ trait PatternMatching extends Transform with TypingTransformers with ast.TreeDSL // (the prefix of the argument passed to the unapply must equal the prefix of the type of the binder) val treeMaker = TypeTestTreeMaker(patBinder, patBinder, extractor.paramType, extractor.paramType)(pos, extractorArgTypeTest = true) (List(treeMaker), treeMaker.nextBinder) - } else (Nil, patBinder) + } else { + // no type test needed, but the tree maker relies on `patBinderOrCasted` having type `extractor.paramType` (and not just some type compatible with it) + // SI-6624 shows this is necessary because apparently patBinder may have an unfortunate type (.decls don't have the case field accessors) + // TODO: get to the bottom of this -- I assume it happens when type checking infers a weird type for an unapply call + // by going back to the parameterType for the extractor call we get a saner type, so let's just do that for now + /* TODO: uncomment when `settings.developer` and `devWarning` become available + if (settings.developer.value && !(patBinder.info =:= extractor.paramType)) + devWarning(s"resetting info of $patBinder: ${patBinder.info} to ${extractor.paramType}") + */ + (Nil, patBinder setInfo extractor.paramType) + } withSubPats(typeTestTreeMaker :+ extractor.treeMaker(patBinderOrCasted, pos), extractor.subBindersAndPatterns: _*) } |