diff options
author | Paul Phillips <paulp@improving.org> | 2012-10-02 11:21:16 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-10-04 16:01:47 -0700 |
commit | 120e14fadf30b4c39f953832108d19b736dc6f2d (patch) | |
tree | f912a4b14f275de00ae02dbe7df4eacbd18de940 /src | |
parent | 4715d782d4f4f1f36c11d26023f970a25f2a8c23 (diff) | |
download | scala-120e14fadf30b4c39f953832108d19b736dc6f2d.tar.gz scala-120e14fadf30b4c39f953832108d19b736dc6f2d.tar.bz2 scala-120e14fadf30b4c39f953832108d19b736dc6f2d.zip |
Fix for rangepos crasher.
wrapClassTagUnapply was generating an unpositioned tree
which would crash under -Yrangepos. See SI-6338.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 5 |
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 12e26a812d..cf9a07a7e4 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -3298,12 +3298,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`]) |