summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Namers.scala
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 /src/compiler/scala/tools/nsc/typechecker/Namers.scala
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 'src/compiler/scala/tools/nsc/typechecker/Namers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Namers.scala1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
index fdff2f3076..e876d4a6af 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
@@ -1643,6 +1643,7 @@ trait Namers extends MethodSynthesis {
def symbolAllowsDeferred = (
sym.isValueParameter
|| sym.isTypeParameterOrSkolem
+ || (sym.isAbstractType && sym.owner.isClass)
|| context.tree.isInstanceOf[ExistentialTypeTree]
)
// Does the symbol owner require no undefined members?