From 5efc9f2257b8ab5ba43489e37c5fbe2e690195bd Mon Sep 17 00:00:00 2001 From: Mikhael Bogdanov Date: Thu, 26 Apr 2018 13:23:00 +0200 Subject: [PATCH] Revert "Get rid of 'BRIDGE' flag on $default functions" Removed bridge flag triggers problem with Spring Boot: KT-23973 This reverts commit cdcb651 #KT-23973 Fixed --- .../src/org/jetbrains/kotlin/codegen/FunctionCodegen.java | 2 +- .../writeFlags/function/withDefaultArguments/funInClass.kt | 2 +- .../function/withDefaultArguments/funInClassObject.kt | 2 +- .../function/withDefaultArguments/inlineOnlyFunInClass.kt | 2 +- .../function/withDefaultArguments/reifiedFunInClass.kt | 2 +- .../writeFlags/function/withDefaultArguments/topLevelFun.kt | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/FunctionCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/FunctionCodegen.java index f7d4da5a340..ba002c58f74 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/FunctionCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/FunctionCodegen.java @@ -1078,7 +1078,7 @@ public class FunctionCodegen { AsmUtil.NO_FLAG_PACKAGE_PRIVATE : Opcodes.ACC_PUBLIC; int flags = visibilityFlag | getDeprecatedAccessFlag(functionDescriptor) | ACC_SYNTHETIC; if (!(functionDescriptor instanceof ConstructorDescriptor)) { - flags |= ACC_STATIC; + flags |= ACC_STATIC | ACC_BRIDGE; } Method defaultMethod = typeMapper.mapDefaultMethod(functionDescriptor, kind); diff --git a/compiler/testData/writeFlags/function/withDefaultArguments/funInClass.kt b/compiler/testData/writeFlags/function/withDefaultArguments/funInClass.kt index df31e2d9afa..4bbadfb4483 100644 --- a/compiler/testData/writeFlags/function/withDefaultArguments/funInClass.kt +++ b/compiler/testData/writeFlags/function/withDefaultArguments/funInClass.kt @@ -4,4 +4,4 @@ class MyClass() { // TESTED_OBJECT_KIND: function // TESTED_OBJECTS: MyClass, test$default -// FLAGS: ACC_PUBLIC, ACC_STATIC, ACC_SYNTHETIC +// FLAGS: ACC_PUBLIC, ACC_STATIC, ACC_BRIDGE, ACC_SYNTHETIC diff --git a/compiler/testData/writeFlags/function/withDefaultArguments/funInClassObject.kt b/compiler/testData/writeFlags/function/withDefaultArguments/funInClassObject.kt index 57b80e3fb37..86126468c3f 100644 --- a/compiler/testData/writeFlags/function/withDefaultArguments/funInClassObject.kt +++ b/compiler/testData/writeFlags/function/withDefaultArguments/funInClassObject.kt @@ -6,4 +6,4 @@ class MyClass() { // TESTED_OBJECT_KIND: function // TESTED_OBJECTS: MyClass$Companion, test$default -// FLAGS: ACC_PUBLIC, ACC_STATIC, ACC_SYNTHETIC +// FLAGS: ACC_PUBLIC, ACC_STATIC, ACC_BRIDGE, ACC_SYNTHETIC diff --git a/compiler/testData/writeFlags/function/withDefaultArguments/inlineOnlyFunInClass.kt b/compiler/testData/writeFlags/function/withDefaultArguments/inlineOnlyFunInClass.kt index 5a7d777311f..9d64aacab0e 100644 --- a/compiler/testData/writeFlags/function/withDefaultArguments/inlineOnlyFunInClass.kt +++ b/compiler/testData/writeFlags/function/withDefaultArguments/inlineOnlyFunInClass.kt @@ -7,4 +7,4 @@ class MyClass() { // TESTED_OBJECT_KIND: function // TESTED_OBJECTS: MyClass, test$default -// FLAGS: ACC_STATIC, ACC_SYNTHETIC +// FLAGS: ACC_STATIC, ACC_BRIDGE, ACC_SYNTHETIC diff --git a/compiler/testData/writeFlags/function/withDefaultArguments/reifiedFunInClass.kt b/compiler/testData/writeFlags/function/withDefaultArguments/reifiedFunInClass.kt index 4439b2d2a40..362f7424265 100644 --- a/compiler/testData/writeFlags/function/withDefaultArguments/reifiedFunInClass.kt +++ b/compiler/testData/writeFlags/function/withDefaultArguments/reifiedFunInClass.kt @@ -4,4 +4,4 @@ class MyClass() { // TESTED_OBJECT_KIND: function // TESTED_OBJECTS: MyClass, test$default -// FLAGS: ACC_STATIC, ACC_SYNTHETIC +// FLAGS: ACC_STATIC, ACC_BRIDGE, ACC_SYNTHETIC diff --git a/compiler/testData/writeFlags/function/withDefaultArguments/topLevelFun.kt b/compiler/testData/writeFlags/function/withDefaultArguments/topLevelFun.kt index 6385ae7fc34..1672055c51b 100644 --- a/compiler/testData/writeFlags/function/withDefaultArguments/topLevelFun.kt +++ b/compiler/testData/writeFlags/function/withDefaultArguments/topLevelFun.kt @@ -2,4 +2,4 @@ fun test(s: String = "") {} // TESTED_OBJECT_KIND: function // TESTED_OBJECTS: TopLevelFunKt, test$default -// FLAGS: ACC_PUBLIC, ACC_STATIC, ACC_SYNTHETIC +// FLAGS: ACC_PUBLIC, ACC_STATIC, ACC_BRIDGE, ACC_SYNTHETIC