Correct CFA order for enums: first own members, then entries, and at last companion object members #KT-6054 Fixed
(cherry picked from commit 94d3b4c)
This commit is contained in:
committed by
Mikhail Glukhikh
parent
1bc7b4e363
commit
13e64c18d9
@@ -1267,6 +1267,16 @@ class ControlFlowProcessor(private val trace: BindingTrace) {
|
||||
}
|
||||
|
||||
override fun visitClass(klass: KtClass) {
|
||||
if (klass.hasPrimaryConstructor()) {
|
||||
processParameters(klass.getPrimaryConstructorParameters())
|
||||
|
||||
// delegation specifiers of primary constructor, anonymous class and property initializers
|
||||
generateHeaderDelegationSpecifiers(klass)
|
||||
generateInitializersForScriptClassOrObject(klass)
|
||||
}
|
||||
|
||||
generateDeclarationForLocalClassOrObjectIfNeeded(klass)
|
||||
|
||||
if (klass.isEnum()) {
|
||||
klass.declarations.forEach {
|
||||
when (it) {
|
||||
@@ -1279,21 +1289,12 @@ class ControlFlowProcessor(private val trace: BindingTrace) {
|
||||
generateInstructions(it)
|
||||
}
|
||||
}
|
||||
is KtObjectDeclaration -> {
|
||||
is KtObjectDeclaration -> if (it.isCompanion()) {
|
||||
generateInstructions(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (klass.hasPrimaryConstructor()) {
|
||||
processParameters(klass.getPrimaryConstructorParameters())
|
||||
|
||||
// delegation specifiers of primary constructor, anonymous class and property initializers
|
||||
generateHeaderDelegationSpecifiers(klass)
|
||||
generateInitializersForScriptClassOrObject(klass)
|
||||
}
|
||||
|
||||
generateDeclarationForLocalClassOrObjectIfNeeded(klass)
|
||||
}
|
||||
|
||||
override fun visitScript(script: KtScript) {
|
||||
|
||||
Reference in New Issue
Block a user