diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2012-07-08 14:51:12 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2012-07-08 16:30:10 +0200 |
commit | da587e31782ecbad27bd9d9247100b3ac1827b11 (patch) | |
tree | 8518630f7058f3a0387bb0ecdcb63fb23d85ac8d /test/files | |
parent | f2dbe673756302d5f5824fd8d0e6e3b3eb45a57b (diff) | |
download | scala-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/files')
-rw-r--r-- | test/files/neg/t6042.check | 4 | ||||
-rw-r--r-- | test/files/neg/t6042.scala | 8 |
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` +} |