diff options
author | liu fengyun <liufengyunchina@gmail.com> | 2016-07-21 10:41:59 +0200 |
---|---|---|
committer | liu fengyun <liufengyunchina@gmail.com> | 2016-08-24 10:26:58 +0200 |
commit | 1a7618f32c6d8060c3a87ce633645440d500aa7a (patch) | |
tree | c61d576426280d36417e64198716c71aa9e0b6ca /src/dotty/tools/dotc/core/classfile | |
parent | 265ade02e522c89844076b5339267eac08e44c37 (diff) | |
download | dotty-1a7618f32c6d8060c3a87ce633645440d500aa7a.tar.gz dotty-1a7618f32c6d8060c3a87ce633645440d500aa7a.tar.bz2 dotty-1a7618f32c6d8060c3a87ce633645440d500aa7a.zip |
implementation of exhaustivity and redundancy check
Diffstat (limited to 'src/dotty/tools/dotc/core/classfile')
-rw-r--r-- | src/dotty/tools/dotc/core/classfile/ClassfileParser.scala | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala b/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala index 4ea98f7c3..1570dbca0 100644 --- a/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala +++ b/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala @@ -85,6 +85,7 @@ class ClassfileParser( val jflags = in.nextChar val isAnnotation = hasAnnotation(jflags) val sflags = classTranslation.flags(jflags) + val isEnum = (jflags & JAVA_ACC_ENUM) != 0 val nameIdx = in.nextChar currentClassName = pool.getClassName(nameIdx) @@ -140,6 +141,15 @@ class ClassfileParser( setClassInfo(classRoot, classInfo) setClassInfo(moduleRoot, staticInfo) } + + // eager load java enum definitions for exhaustivity check of pattern match + if (isEnum) { + instanceScope.toList.map(_.ensureCompleted()) + staticScope.toList.map(_.ensureCompleted()) + classRoot.setFlag(Flags.Enum) + moduleRoot.setFlag(Flags.Enum) + } + result } |