JVM_IR: do not generate two nullary constructors

when the primary constructor with @JvmOverloads has default values for
all arguments.
This commit is contained in:
pyos
2019-06-24 11:04:46 +02:00
committed by max-kammerer
parent 40957ad46a
commit 6a21285aed
6 changed files with 30 additions and 2 deletions
@@ -115,7 +115,6 @@ val jvmPhases = namedIrFilePhase<JvmBackendContext>(
annotationPhase then
tailrecPhase then
jvmDefaultConstructorPhase then
jvmInlineClassPhase then
defaultArgumentStubPhase then
@@ -146,6 +145,7 @@ val jvmPhases = namedIrFilePhase<JvmBackendContext>(
collectionStubMethodLowering then
bridgePhase then
jvmOverloadsAnnotationPhase then
jvmDefaultConstructorPhase then
jvmStaticAnnotationPhase then
staticDefaultFunctionPhase then
@@ -20,7 +20,8 @@ import org.jetbrains.kotlin.ir.util.hasDefaultValue
internal val jvmDefaultConstructorPhase = makeIrFilePhase(
::JvmDefaultConstructorLowering,
name = "JvmDefaultConstructor",
description = "Generate default constructors for Java"
description = "Generate default constructors for Java",
prerequisite = setOf(jvmOverloadsAnnotationPhase)
)
// Quoted from https://kotlinlang.org/docs/reference/classes.html