Load Java enums as final classes

In case Java enum has an abstract member, it has the ACC_ABSTRACT flag
set in the bytecode. However, we should still load it with final
modality to be consistent with Kotlin enums which are always considered
final

 #KT-23426 Fixed
This commit is contained in:
Alexander Udalov
2019-04-05 22:11:37 +02:00
parent 2f003ef545
commit d257285c86
10 changed files with 111 additions and 5 deletions
@@ -72,7 +72,7 @@ class LazyJavaClassDescriptor(
}
private val modality =
if (jClass.isAnnotationType) Modality.FINAL
if (jClass.isAnnotationType || jClass.isEnum) Modality.FINAL
else Modality.convertFromFlags(jClass.isAbstract || jClass.isInterface, !jClass.isFinal)
private val visibility = jClass.visibility