Create expect/actual class: fix inline class generation

#KT-28744 Fixed
#KT-28745 Fixed
This commit is contained in:
Mikhail Glukhikh
2018-12-11 20:29:01 +03:00
parent d3a5b0dcd6
commit ca3d758fba
11 changed files with 40 additions and 8 deletions
@@ -139,10 +139,16 @@ fun OverrideMemberChooserObject.generateMember(
else -> bodyType
}
val renderer = when {
val renderer = if (!forceActual && !forceExpect) OVERRIDE_RENDERER else when {
forceActual -> ACTUAL_RENDERER
forceExpect -> EXPECT_RENDERER
else -> OVERRIDE_RENDERER
else -> EXPECT_RENDERER
}.withOptions {
if (descriptor is ClassConstructorDescriptor && descriptor.isPrimary) {
val containingClass = descriptor.containingDeclaration
if (containingClass.kind == ClassKind.ANNOTATION_CLASS || containingClass.isInline) {
renderPrimaryConstructorParametersAsProperties = true
}
}
}
if (preferConstructorParameter && descriptor is PropertyDescriptor) {
@@ -214,7 +220,6 @@ private val EXPECT_RENDERER = OVERRIDE_RENDERER.withOptions {
secondaryConstructorsAsPrimary = false
renderDefaultVisibility = false
renderDefaultModality = false
renderAnnotationPropertiesInPrimaryConstructor = true
renderTypeExpansions = true
}