From b70ff30dc38a62f5ed5d581cf633ff06118e21f2 Mon Sep 17 00:00:00 2001 From: Mikhael Bogdanov Date: Wed, 17 Apr 2019 14:23:36 +0200 Subject: [PATCH] Don't generate bridge flag for defaults in JVM IR backend --- .../org/jetbrains/kotlin/backend/jvm/codegen/FunctionCodegen.kt | 2 +- .../writeFlags/function/withDefaultArguments/funInClass.kt | 1 - .../function/withDefaultArguments/funInClassObject.kt | 1 - .../writeFlags/function/withDefaultArguments/topLevelFun.kt | 1 - 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/FunctionCodegen.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/FunctionCodegen.kt index 1ecd319eb24..7d48a083f72 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/FunctionCodegen.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/FunctionCodegen.kt @@ -69,7 +69,7 @@ open class FunctionCodegen( private fun calculateMethodFlags(isStatic: Boolean): Int { if (irFunction.origin == IrDeclarationOrigin.FUNCTION_FOR_DEFAULT_PARAMETER) { return Opcodes.ACC_PUBLIC or Opcodes.ACC_SYNTHETIC.let { - if (irFunction is IrConstructor) it else it or Opcodes.ACC_BRIDGE or Opcodes.ACC_STATIC + if (irFunction is IrConstructor) it else it or Opcodes.ACC_STATIC } } diff --git a/compiler/testData/writeFlags/function/withDefaultArguments/funInClass.kt b/compiler/testData/writeFlags/function/withDefaultArguments/funInClass.kt index a63a5acc3b7..df31e2d9afa 100644 --- a/compiler/testData/writeFlags/function/withDefaultArguments/funInClass.kt +++ b/compiler/testData/writeFlags/function/withDefaultArguments/funInClass.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR class MyClass() { fun test(s: String = "") {} } diff --git a/compiler/testData/writeFlags/function/withDefaultArguments/funInClassObject.kt b/compiler/testData/writeFlags/function/withDefaultArguments/funInClassObject.kt index 7465ddaa141..57b80e3fb37 100644 --- a/compiler/testData/writeFlags/function/withDefaultArguments/funInClassObject.kt +++ b/compiler/testData/writeFlags/function/withDefaultArguments/funInClassObject.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR class MyClass() { companion object { fun test(s: String, x:Int = 10) {} diff --git a/compiler/testData/writeFlags/function/withDefaultArguments/topLevelFun.kt b/compiler/testData/writeFlags/function/withDefaultArguments/topLevelFun.kt index 7cee9ef42d1..6385ae7fc34 100644 --- a/compiler/testData/writeFlags/function/withDefaultArguments/topLevelFun.kt +++ b/compiler/testData/writeFlags/function/withDefaultArguments/topLevelFun.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR fun test(s: String = "") {} // TESTED_OBJECT_KIND: function