summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-10-02 11:21:16 -0700
committerJason Zaugg <jzaugg@gmail.com>2012-12-04 16:06:48 +0100
commiteccdc2fefcf0839e09bb9c63c89baed8cf09e60f (patch)
treec634d8069a99d1d2f06741e981159cb83b1d79cc /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parent70a24f907b07ea030419ef686a56272233ddd3ee (diff)
downloadscala-eccdc2fefcf0839e09bb9c63c89baed8cf09e60f.tar.gz
scala-eccdc2fefcf0839e09bb9c63c89baed8cf09e60f.tar.bz2
scala-eccdc2fefcf0839e09bb9c63c89baed8cf09e60f.zip
Fix for rangepos crasher.
wrapClassTagUnapply was generating an unpositioned tree which would crash under -Yrangepos. See SI-6338.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 934ba91ac8..b823e1ad0f 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -3362,12 +3362,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`])