summaryrefslogtreecommitdiff
path: root/test/files/pos/t7756b.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-08-16 14:18:20 +0200
committerJason Zaugg <jzaugg@gmail.com>2014-09-23 16:27:33 +1000
commit0022dccfde2f2d1e383254d8b5677c2468b57701 (patch)
tree70e0fa624cebc58e268aaacb6a7da3417721af15 /test/files/pos/t7756b.scala
parent5720e97b95da57c9549698a9038efb79092394ad (diff)
downloadscala-0022dccfde2f2d1e383254d8b5677c2468b57701.tar.gz
scala-0022dccfde2f2d1e383254d8b5677c2468b57701.tar.bz2
scala-0022dccfde2f2d1e383254d8b5677c2468b57701.zip
[backport] SI-7756 Uncripple refchecks in case bodies
In 65340ed4ad2e, parts of RefChecks were disabled when we traversed into the results of the new pattern matcher. Similar logic existed for the old pattern matcher, but in that case the Match / CaseDef nodes still existed in the tree. The new approach was too broad: important checks no longer scrutinized the body of cases. This commit turns the checks back on when it finds the remnants of a case body, which appears as an application to a label def. Conflicts: src/compiler/scala/tools/nsc/typechecker/RefChecks.scala Cherry pick of 3df1d77fc984b976efa68098206e801cf3b83a9e
Diffstat (limited to 'test/files/pos/t7756b.scala')
-rw-r--r--test/files/pos/t7756b.scala13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/files/pos/t7756b.scala b/test/files/pos/t7756b.scala
new file mode 100644
index 0000000000..009248510d
--- /dev/null
+++ b/test/files/pos/t7756b.scala
@@ -0,0 +1,13 @@
+// This is a pos test to show that the backported bug fix for SI-7756 is
+// only enabled under -Xfuture.
+object Test {
+ def test: Unit = {
+ trait TA[X <: CharSequence]
+ 0 match {
+ case _ =>
+ // the bounds violation isn't reported. RefChecks seems to be too broadly disabled under virtpatmat: see 65340ed4ad2e
+ locally(null: TA[Object])
+ ()
+ }
+ }
+}