diff options
author | Paul Phillips <paulp@improving.org> | 2012-12-05 12:26:46 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-12-05 12:26:46 -0800 |
commit | b84ecc5d1afcb71dd4047de9f1cc49060835d3df (patch) | |
tree | 07feb0c89c2f808f676e541e09d8e0e139c2cb85 /src | |
parent | edbcc64483ac0009eeeb58fe31e57a411da9e4c6 (diff) | |
parent | 18481cef9b219c48b3497c4605b793b22a7faf79 (diff) | |
download | scala-b84ecc5d1afcb71dd4047de9f1cc49060835d3df.tar.gz scala-b84ecc5d1afcb71dd4047de9f1cc49060835d3df.tar.bz2 scala-b84ecc5d1afcb71dd4047de9f1cc49060835d3df.zip |
Merge remote-tracking branch 'origin/2.10.0-wip' into merge-2.10-wip
# By Eugene Burmako (1) and others
# Via Adriaan Moors (2) and others
* origin/2.10.0-wip:
Fixing OSGi distribution.
Fix for rangepos crasher.
SI-6685 fixes error handling in typedApply
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index ae506cd6ab..802b42f6c7 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -3367,12 +3367,13 @@ trait Typers extends Modes with Adaptations with Tags { // println(util.Position.formatMessage(uncheckedPattern.pos, "made unchecked type test into a checked one", true)) val args = List(uncheckedPattern) + val app = atPos(uncheckedPattern.pos)(Apply(classTagExtractor, args)) // must call doTypedUnapply directly, as otherwise we get undesirable rewrites // and re-typechecks of the target of the unapply call in PATTERNmode, // this breaks down when the classTagExtractor (which defineds the unapply member) is not a simple reference to an object, // but an arbitrary tree as is the case here - doTypedUnapply(Apply(classTagExtractor, args), classTagExtractor, classTagExtractor, args, PATTERNmode, pt) - } + doTypedUnapply(app, classTagExtractor, classTagExtractor, args, PATTERNmode, pt) + } // if there's a ClassTag that allows us to turn the unchecked type test for `pt` into a checked type test // return the corresponding extractor (an instance of ClassTag[`pt`]) @@ -4517,12 +4518,11 @@ trait Typers extends Modes with Adaptations with Tags { // [Eugene] no more MaxArrayDims. ClassTags are flexible enough to allow creation of arrays of arbitrary dimensionality (w.r.t JVM restrictions) val Some((level, componentType)) = erasure.GenericArray.unapply(tpt.tpe) val tagType = List.iterate(componentType, level)(tpe => appliedType(ArrayClass.toTypeConstructor, List(tpe))).last - val newArrayApp = atPos(tree.pos) { + atPos(tree.pos) { val tag = resolveClassTag(tree.pos, tagType) if (tag.isEmpty) MissingClassTagError(tree, tagType) - else new ApplyToImplicitArgs(Select(tag, nme.newArray), args) + else typed(new ApplyToImplicitArgs(Select(tag, nme.newArray), args)) } - typed(newArrayApp, mode, pt) case Apply(Select(fun, nme.apply), _) if treeInfo.isSuperConstrCall(fun) => //SI-5696 TooManyArgumentListsForConstructor(tree) case tree1 => |