From c27e5f0d60c853868b3676f1449e42dd351b0644 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Sat, 23 Jun 2012 22:38:23 +0200 Subject: SI-5968 Eliminate spurious exhaustiveness warning with singleton types. A singleton type is a type ripe for enumeration. --- src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/compiler') diff --git a/src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala b/src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala index 9b8ddffb49..f99d0e733b 100644 --- a/src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala +++ b/src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala @@ -2362,6 +2362,8 @@ trait PatternMatching extends Transform with TypingTransformers with ast.TreeDSL // patmatDebug("enum bool "+ tp) Some(List(ConstantType(Constant(true)), ConstantType(Constant(false)))) // TODO case _ if tp.isTupleType => // recurse into component types + case modSym: ModuleClassSymbol => + Some(List(tp)) case sym if !sym.isSealed || isPrimitiveValueClass(sym) => // patmatDebug("enum unsealed "+ (tp, sym, sym.isSealed, isPrimitiveValueClass(sym))) None -- cgit v1.2.3