summaryrefslogtreecommitdiff
path: root/src/reflect
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-01-31 07:37:01 -0800
committerPaul Phillips <paulp@improving.org>2013-01-31 07:37:01 -0800
commit42c4cc7a1eed222a1593c6ac2652cd5357c2897a (patch)
treefce2af644c22a08e35ca40c2d6b2a0dc7d29559d /src/reflect
parentba72ee7c6f556827a1e8100d9193f0452c5313a1 (diff)
parenta87d40960bfdb4a683c05d3430a8874cb4dcff36 (diff)
downloadscala-42c4cc7a1eed222a1593c6ac2652cd5357c2897a.tar.gz
scala-42c4cc7a1eed222a1593c6ac2652cd5357c2897a.tar.bz2
scala-42c4cc7a1eed222a1593c6ac2652cd5357c2897a.zip
Merge pull request #1989 from adriaanm/rework-pr-1945
SI-6968 Simple Tuple patterns aren't irrefutable
Diffstat (limited to 'src/reflect')
-rw-r--r--src/reflect/scala/reflect/internal/TreeInfo.scala18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/reflect/scala/reflect/internal/TreeInfo.scala b/src/reflect/scala/reflect/internal/TreeInfo.scala
index e1a18570b2..98c1afb323 100644
--- a/src/reflect/scala/reflect/internal/TreeInfo.scala
+++ b/src/reflect/scala/reflect/internal/TreeInfo.scala
@@ -261,22 +261,24 @@ abstract class TreeInfo {
* in the position `for { <tree> <- expr }` based only
* on information at the `parser` phase? To qualify, there
* may be no subtree that will be interpreted as a
- * Stable Identifier Pattern.
+ * Stable Identifier Pattern, nor any type tests, even
+ * on TupleN. See SI-6968.
*
* For instance:
*
* {{{
- * foo @ (bar, (baz, quux))
+ * (foo @ (bar @ _)) = 0
* }}}
*
- * is a variable pattern; if the structure matches,
- * then the remainder is inevitable.
+ * is a not a variable pattern; if only binds names.
*
* The following are not variable patterns.
*
* {{{
- * foo @ (bar, (`baz`, quux)) // back quoted ident, not at top level
- * foo @ (bar, Quux) // UpperCase ident, not at top level
+ * `bar`
+ * Bar
+ * (a, b)
+ * _: T
* }}}
*
* If the pattern is a simple identifier, it is always
@@ -305,10 +307,6 @@ abstract class TreeInfo {
tree match {
case Bind(name, pat) => isVarPatternDeep0(pat)
case Ident(name) => isVarPattern(tree)
- case Apply(sel, args) =>
- ( isReferenceToScalaMember(sel, TupleClass(args.size).name.toTermName)
- && (args forall isVarPatternDeep0)
- )
case _ => false
}
}