diff options
author | Paul Phillips <paulp@improving.org> | 2011-02-20 02:13:31 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-02-20 02:13:31 +0000 |
commit | 6a570deed1790889f7036a00c045c15217313587 (patch) | |
tree | 687167b722efdc8815dac76d435e033b4534919c /src | |
parent | c3ebada7e6c604416656d47d3cd869bddd430932 (diff) | |
download | scala-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')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 9 |
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 } |