summaryrefslogtreecommitdiff
path: root/test/files/neg/t963.check
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2014-11-08 22:50:47 +1000
committerJason Zaugg <jzaugg@gmail.com>2014-11-09 09:48:39 +1000
commit5f50e0368e635db8279797095dbd34470722d5c7 (patch)
treeb60350f560123f74007a5cb70b9424d417f9bd7f /test/files/neg/t963.check
parentb431a4bd83d3bfb2b95d0426d2905b34ce1265ad (diff)
downloadscala-5f50e0368e635db8279797095dbd34470722d5c7.tar.gz
scala-5f50e0368e635db8279797095dbd34470722d5c7.tar.bz2
scala-5f50e0368e635db8279797095dbd34470722d5c7.zip
SI-8534 Avoid crash in erroneous SelectFromTypeTree
PR #2374 changed the behaviour of `typedSingletonTypeTree` in the presence of an error typed reference tree. It incorrectly returns the reference tree in case on an error. However, this is a term tree, which is an inconsistent result with the input type tree. Consequently, a `typedSelectInternal` later fails when using this as the qualifier of a `SelectFromTypeTree`. Both test cases enclosed show this symptom. This commit: - Returns `tree` rather than `refTyped` when `refTyped` is error typed or when it isn't suitable as a stable prefix. - Avoids issuing a cascading "not a stable prefix" error if the `refTyped` is error typed. - Adds an extra layer of defense in `typedSelectFromTypeTree` to bail out quickly if the qualifier is error typed. The last measure is not necessary to fix this bug.
Diffstat (limited to 'test/files/neg/t963.check')
-rw-r--r--test/files/neg/t963.check8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/files/neg/t963.check b/test/files/neg/t963.check
index 4dc202c7bd..483e53c77d 100644
--- a/test/files/neg/t963.check
+++ b/test/files/neg/t963.check
@@ -1,9 +1,9 @@
-t963.scala:14: error: stable identifier required, but Test.this.y3.x found.
+t963.scala:14: error: stable identifier required, but y3.x.type found.
val w3 : y3.x.type = y3.x
- ^
-t963.scala:17: error: stable identifier required, but Test.this.y4.x found.
+ ^
+t963.scala:17: error: stable identifier required, but y4.x.type found.
val w4 : y4.x.type = y4.x
- ^
+ ^
t963.scala:10: error: type mismatch;
found : AnyRef{def x: Integer}
required: AnyRef{val x: Integer}