summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-12-11 10:01:20 -0800
committerPaul Phillips <paulp@improving.org>2012-12-11 10:01:20 -0800
commit0fd2d80e0129c7fa7d2b081cc35b06ca5651c3a5 (patch)
tree60a9ceaeea6f0b2e54177c6bd37ac8b7b0ed2f25
parentc9bca57781ffa64e0d081facf668775f6eaff2e8 (diff)
parent18481cef9b219c48b3497c4605b793b22a7faf79 (diff)
downloadscala-0fd2d80e0129c7fa7d2b081cc35b06ca5651c3a5.tar.gz
scala-0fd2d80e0129c7fa7d2b081cc35b06ca5651c3a5.tar.bz2
scala-0fd2d80e0129c7fa7d2b081cc35b06ca5651c3a5.zip
Merge remote-tracking branch 'origin/2.10.0-wip' into merge-wip-into-2.10.x
# 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
-rw-r--r--build.xml7
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala10
-rw-r--r--test/files/pos/classtag-pos.flags1
-rw-r--r--test/files/pos/classtag-pos.scala5
4 files changed, 17 insertions, 6 deletions
diff --git a/build.xml b/build.xml
index 95e324250a..ae7a187d79 100644
--- a/build.xml
+++ b/build.xml
@@ -2706,7 +2706,12 @@ DISTRIBUTION
<target name="dist.base" depends="dist.start">
<mkdir dir="${dist.dir}/lib"/>
<copy toDir="${dist.dir}/lib">
- <fileset dir="${build-pack.dir}/lib"/>
+ <fileset dir="${build-pack.dir}/lib">
+ <include name="jline.jar"/>
+ <include name="scalacheck.jar"/>
+ <include name="scala-partest.jar"/>
+ <include name="scalap.jar"/>
+ </fileset>
</copy>
<mkdir dir="${dist.dir}/bin"/>
<!-- TODO - Stop being inefficient and don't copy OSGi bundles overtop other jars. -->
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 83ded04c39..7db2259e3b 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -3499,12 +3499,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`])
@@ -4648,12 +4649,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 =>
diff --git a/test/files/pos/classtag-pos.flags b/test/files/pos/classtag-pos.flags
new file mode 100644
index 0000000000..281f0a10cd
--- /dev/null
+++ b/test/files/pos/classtag-pos.flags
@@ -0,0 +1 @@
+-Yrangepos
diff --git a/test/files/pos/classtag-pos.scala b/test/files/pos/classtag-pos.scala
new file mode 100644
index 0000000000..768d2e27f4
--- /dev/null
+++ b/test/files/pos/classtag-pos.scala
@@ -0,0 +1,5 @@
+import scala.reflect.runtime.universe._
+
+class A {
+ def f[T: TypeTag] = typeOf[T] match { case TypeRef(_, _, args) => args }
+}