summaryrefslogtreecommitdiff
path: root/test/files/neg/t8217-local-alias-requires-rhs.check
diff options
context:
space:
mode:
authorPaolo G. Giarrusso <p.giarrusso@gmail.com>2014-01-31 19:43:08 +0100
committerJason Zaugg <jzaugg@gmail.com>2014-10-01 21:01:11 +1000
commit0d8ca1f5fe335565f861ce2c58f7f684f15a4064 (patch)
treed36ec77b840f24e164dc6e5436431318bae7d1d4 /test/files/neg/t8217-local-alias-requires-rhs.check
parent7b591540fd46f4e8d6e4f589efe7abe468d69ca4 (diff)
downloadscala-0d8ca1f5fe335565f861ce2c58f7f684f15a4064.tar.gz
scala-0d8ca1f5fe335565f861ce2c58f7f684f15a4064.tar.bz2
scala-0d8ca1f5fe335565f861ce2c58f7f684f15a4064.zip
SI-8217 allow abstract type members in objects
Previously, abstract type members were allowed in objects only when inherited, but not when declared directly. This inconsistency was not intended. In dotty, abstract type members are allowed in values and represent existentials; so upon discussion, it was decided to fix things to conform to dotty and allow such type members. Adriaan also asked to keep rejecting abstract type members in methods even though they would conceivably make sense. Discussions happened on #3407, scala/scala-dist#127. This code is improved from #3442, keeps closer to the current logic, and passes tests. Existing tests that have been converted to `pos` tests show that this works, and a new test has been added to show that local aliases (ie term-owned) without a RHS are still rejected.
Diffstat (limited to 'test/files/neg/t8217-local-alias-requires-rhs.check')
-rw-r--r--test/files/neg/t8217-local-alias-requires-rhs.check10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/files/neg/t8217-local-alias-requires-rhs.check b/test/files/neg/t8217-local-alias-requires-rhs.check
new file mode 100644
index 0000000000..0d4f0864ba
--- /dev/null
+++ b/test/files/neg/t8217-local-alias-requires-rhs.check
@@ -0,0 +1,10 @@
+t8217-local-alias-requires-rhs.scala:6: error: only classes can have declared but undefined members
+ type B
+ ^
+t8217-local-alias-requires-rhs.scala:3: error: only classes can have declared but undefined members
+ type A
+ ^
+t8217-local-alias-requires-rhs.scala:14: error: only classes can have declared but undefined members
+ def this(a: Any) = { this(); type C }
+ ^
+three errors found