diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/matching/MatrixAdditions.scala | 10 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/Definitions.scala | 2 |
2 files changed, 4 insertions, 8 deletions
diff --git a/src/compiler/scala/tools/nsc/matching/MatrixAdditions.scala b/src/compiler/scala/tools/nsc/matching/MatrixAdditions.scala index 4a1a423b7f..37ddbbc671 100644 --- a/src/compiler/scala/tools/nsc/matching/MatrixAdditions.scala +++ b/src/compiler/scala/tools/nsc/matching/MatrixAdditions.scala @@ -198,14 +198,10 @@ trait MatrixAdditions extends ast.TreeDSL { s resetFlag MUTABLE ; true } // side effects MUTABLE flag private def sealedSymsFor(s: Symbol): Set[Symbol] = { - def countSealed(child: Symbol) = { - // include base class only if non-abstract - def baseSet = if (child hasFlag ABSTRACT) Set() else Set(child) - sealedSymsFor(child) ++ baseSet - } - if (s hasFlag SEALED) s.children flatMap countSealed - else Set() + val kids = s.children flatMap sealedSymsFor + if (s hasFlag ABSTRACT) kids else kids + s } + private lazy val inexhaustives: List[List[Combo]] = { val collected = for ((pv, i) <- tvars.zipWithIndex ; val sym = pv.lhs ; if requiresExhaustive(sym)) yield diff --git a/src/compiler/scala/tools/nsc/symtab/Definitions.scala b/src/compiler/scala/tools/nsc/symtab/Definitions.scala index 9c2df4a6cb..6aa18d583f 100644 --- a/src/compiler/scala/tools/nsc/symtab/Definitions.scala +++ b/src/compiler/scala/tools/nsc/symtab/Definitions.scala @@ -53,7 +53,7 @@ trait Definitions { // top types lazy val AnyClass = newClass(ScalaPackageClass, nme.Any, Nil) setFlag (ABSTRACT) - lazy val AnyValClass = newClass(ScalaPackageClass, nme.AnyVal, anyparam) setFlag (FINAL | SEALED) + lazy val AnyValClass = newClass(ScalaPackageClass, nme.AnyVal, anyparam) setFlag (ABSTRACT | SEALED) lazy val AnyRefClass = newAlias(ScalaPackageClass, nme.AnyRef, ObjectClass.typeConstructor) lazy val ObjectClass = getClass(sn.Object) |