summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-02-20 02:13:31 +0000
committerPaul Phillips <paulp@improving.org>2011-02-20 02:13:31 +0000
commit6a570deed1790889f7036a00c045c15217313587 (patch)
tree687167b722efdc8815dac76d435e033b4534919c /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parentc3ebada7e6c604416656d47d3cd869bddd430932 (diff)
downloadscala-6a570deed1790889f7036a00c045c15217313587.tar.gz
scala-6a570deed1790889f7036a00c045c15217313587.tar.bz2
scala-6a570deed1790889f7036a00c045c15217313587.zip
Observed that some historical issues with packa...
Observed that some historical issues with package objects no longer seem so issuey. In the interests of keeping the arbitrary limitations to a minimum, re-enabled case classes in package objects (see #2130, #3437.) Closes #3437, review by odersky.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 4d282a4e7d..649af74d43 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -1253,10 +1253,10 @@ trait Typers extends Modes {
c.initialize
val clazz = mdef.symbol.moduleClass
val maybeAddSerializable = (l: List[Tree]) =>
- if(linkedClass == NoSymbol || !linkedClass.isSerializable || clazz.isSerializable) l
+ if (linkedClass == NoSymbol || !linkedClass.isSerializable || clazz.isSerializable) l
else {
clazz.makeSerializable()
- l ::: List(TypeTree(SerializableClass.tpe))
+ l :+ TypeTree(SerializableClass.tpe)
}
val typedMods = removeAnnotations(mdef.mods)
assert(clazz != NoSymbol)
@@ -1264,11 +1264,6 @@ trait Typers extends Modes {
.typedTemplate(mdef.impl, maybeAddSerializable(parentTypes(mdef.impl)))
val impl2 = typerAddSyntheticMethods(impl1, clazz, context)
- if (mdef.name == nme.PACKAGEkw)
- for (m <- mdef.symbol.info.members)
- if (m.isCaseClass)
- context.error(if (m.pos.isDefined) m.pos else mdef.pos,
- "implementation restriction: "+mdef.symbol+" cannot contain case "+m)
treeCopy.ModuleDef(mdef, typedMods, mdef.name, impl2) setType NoType
}