summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2012-07-08 14:51:12 +0200
committerJason Zaugg <jzaugg@gmail.com>2012-07-08 16:30:10 +0200
commitda587e31782ecbad27bd9d9247100b3ac1827b11 (patch)
tree8518630f7058f3a0387bb0ecdcb63fb23d85ac8d /test
parentf2dbe673756302d5f5824fd8d0e6e3b3eb45a57b (diff)
downloadscala-da587e31782ecbad27bd9d9247100b3ac1827b11.tar.gz
scala-da587e31782ecbad27bd9d9247100b3ac1827b11.tar.bz2
scala-da587e31782ecbad27bd9d9247100b3ac1827b11.zip
SI-6042 Improve type selection from volatile type error
- Display the type of the typed qualifier (qual1), to avoid the message "Illegal type selection from volatile type null". - Show the upper bound, which is used to calculate the volatility.
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/t6042.check4
-rw-r--r--test/files/neg/t6042.scala8
2 files changed, 12 insertions, 0 deletions
diff --git a/test/files/neg/t6042.check b/test/files/neg/t6042.check
new file mode 100644
index 0000000000..221f06e2c5
--- /dev/null
+++ b/test/files/neg/t6042.check
@@ -0,0 +1,4 @@
+t6042.scala:7: error: illegal type selection from volatile type a.OpSemExp (with upper bound LazyExp[a.OpSemExp] with _$1)
+ def foo[AA <: LazyExp[_]](a: AA): a.OpSemExp#Val = ??? // a.OpSemExp is volatile, because of `with This`
+ ^
+one error found
diff --git a/test/files/neg/t6042.scala b/test/files/neg/t6042.scala
new file mode 100644
index 0000000000..5a123d17ca
--- /dev/null
+++ b/test/files/neg/t6042.scala
@@ -0,0 +1,8 @@
+trait LazyExp[+This <: LazyExp[This]] { this: This =>
+ type OpSemExp <: LazyExp[OpSemExp] with This
+ type Val
+}
+
+object Test {
+ def foo[AA <: LazyExp[_]](a: AA): a.OpSemExp#Val = ??? // a.OpSemExp is volatile, because of `with This`
+}