diff options
author | Paul Phillips <paulp@improving.org> | 2011-07-13 05:08:12 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-07-13 05:08:12 +0000 |
commit | e032852d12a301fb8ee8b10fe1f6a6f6eb09b7d4 (patch) | |
tree | f77a759ad5667e358fc91102b76704fd40a0d217 /test/files | |
parent | cda484779f3de0ca59aff243326f5a414e63b946 (diff) | |
download | scala-e032852d12a301fb8ee8b10fe1f6a6f6eb09b7d4.tar.gz scala-e032852d12a301fb8ee8b10fe1f6a6f6eb09b7d4.tar.bz2 scala-e032852d12a301fb8ee8b10fe1f6a6f6eb09b7d4.zip |
Catch type projections even when they disguise ...
Catch type projections even when they disguise themselves as stable via
singleton bounds. Closes #1431, review by odersky.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/neg/bug1431.check | 4 | ||||
-rw-r--r-- | test/files/neg/bug1431.scala | 10 |
2 files changed, 14 insertions, 0 deletions
diff --git a/test/files/neg/bug1431.check b/test/files/neg/bug1431.check new file mode 100644 index 0000000000..0ae28eea9d --- /dev/null +++ b/test/files/neg/bug1431.check @@ -0,0 +1,4 @@ +bug1431.scala:8: error: class type required but X#Factory found + def fun[X<:MyTrait with Singleton]() = new X#Factory().value + ^ +one error found diff --git a/test/files/neg/bug1431.scala b/test/files/neg/bug1431.scala new file mode 100644 index 0000000000..aff1dbc014 --- /dev/null +++ b/test/files/neg/bug1431.scala @@ -0,0 +1,10 @@ +object Bug_New { + trait MyTrait { + type Alpha + def the_value : Alpha + class Factory() {def value : Alpha = the_value} + } + + def fun[X<:MyTrait with Singleton]() = new X#Factory().value +} + |