summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/symtab/classfile
diff options
context:
space:
mode:
authorSimon Ochsenreither <simon@ochsenreither.de>2016-01-07 19:07:45 +0100
committerSimon Ochsenreither <simon@ochsenreither.de>2016-01-14 00:01:40 +0100
commit11783c3c2a6692cfbb41b14734504b86101ed955 (patch)
tree094d7e5b3155f2325e8d6d290772433b1382228e /src/compiler/scala/tools/nsc/symtab/classfile
parentfb22e2b0a73605d654c153e02d454e5cec21f355 (diff)
downloadscala-11783c3c2a6692cfbb41b14734504b86101ed955.tar.gz
scala-11783c3c2a6692cfbb41b14734504b86101ed955.tar.bz2
scala-11783c3c2a6692cfbb41b14734504b86101ed955.zip
SI-8700 Exhaustiveness warning for enums from Java source
Until now, the warning was only emitted for enums from Java class files. This commit fixes it by - aligning the flags set in JavaParsers with the flags set in ClassfileParser (which are required by the pattern matcher to even consider checking exhaustiveness) - adding the enum members as childs to the class holding the enum as done in ClassfileParser so that the pattern matcher sees the enum members when looking for the sealed children of a type
Diffstat (limited to 'src/compiler/scala/tools/nsc/symtab/classfile')
-rw-r--r--src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
index 99e61d2482..406411f21f 100644
--- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
+++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
@@ -542,7 +542,7 @@ abstract class ClassfileParser {
devWarning(s"no linked class for java enum $sym in ${sym.owner}. A referencing class file might be missing an InnerClasses entry.")
case linked =>
if (!linked.isSealed)
- // Marking the enum class SEALED | ABSTRACT enables exhaustiveness checking.
+ // Marking the enum class SEALED | ABSTRACT enables exhaustiveness checking. See also JavaParsers.
// This is a bit of a hack and requires excluding the ABSTRACT flag in the backend, see method javaClassfileFlags.
linked setFlag (SEALED | ABSTRACT)
linked addChild sym