diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ClosureCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ClosureCodegen.java index c8015e44f41..712b97f96a4 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ClosureCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ClosureCodegen.java @@ -275,7 +275,7 @@ public class ClosureCodegen extends MemberCodegen { if (bridge.equals(delegate)) return; MethodVisitor mv = - v.newMethod(JvmDeclarationOriginKt.OtherOrigin(element, funDescriptor), ACC_PUBLIC | ACC_BRIDGE, + v.newMethod(JvmDeclarationOriginKt.OtherOrigin(element, funDescriptor), ACC_PUBLIC | ACC_BRIDGE | ACC_SYNTHETIC, bridge.getName(), bridge.getDescriptor(), null, ArrayUtil.EMPTY_STRING_ARRAY); if (state.getClassBuilderMode() != ClassBuilderMode.FULL) return; diff --git a/compiler/testData/codegen/bytecodeListing/annotations/literals.txt b/compiler/testData/codegen/bytecodeListing/annotations/literals.txt index 23f1368e888..6d5d3013c5b 100644 --- a/compiler/testData/codegen/bytecodeListing/annotations/literals.txt +++ b/compiler/testData/codegen/bytecodeListing/annotations/literals.txt @@ -23,7 +23,7 @@ final class LiteralsKt$foo$1 { inner class LiteralsKt$foo$1 method (p0: int): void public final @FunAnn method invoke(): int - public method invoke(): java.lang.Object + public synthetic method invoke(): java.lang.Object } @kotlin.jvm.internal.KotlinSyntheticClass @@ -33,7 +33,7 @@ final class LiteralsKt$foo$2 { inner class LiteralsKt$foo$2 method (p0: int): void public final method invoke(): int - public method invoke(): java.lang.Object + public synthetic method invoke(): java.lang.Object } @kotlin.jvm.internal.KotlinLocalClass @@ -50,7 +50,7 @@ final class LiteralsKt$foo$x$1 { inner class LiteralsKt$foo$x$1 method (p0: int): void public final @FunAnn method invoke(): int - public method invoke(): java.lang.Object + public synthetic method invoke(): java.lang.Object } @kotlin.jvm.internal.KotlinFileFacade diff --git a/idea/testData/debugger/tinyApp/outs/functionCallStoredToVariable.out b/idea/testData/debugger/tinyApp/outs/functionCallStoredToVariable.out index e231002591a..ac06ea7bb05 100644 --- a/idea/testData/debugger/tinyApp/outs/functionCallStoredToVariable.out +++ b/idea/testData/debugger/tinyApp/outs/functionCallStoredToVariable.out @@ -7,7 +7,6 @@ Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socke functionCallStoredToVariable.kt:7 functionCallStoredToVariable.kt:4 functionCallStoredToVariable.kt:14 -functionCallStoredToVariable.kt:0 functionCallStoredToVariable.kt:43 functionCallStoredToVariable.kt:11 functionCallStoredToVariable.kt:21 @@ -15,7 +14,6 @@ functionCallStoredToVariable.kt:22 functionCallStoredToVariable.kt:18 functionCallStoredToVariable.kt:28 functionCallStoredToVariable.kt:29 -functionCallStoredToVariable.kt:0 functionCallStoredToVariable.kt:47 functionCallStoredToVariable.kt:25 Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' diff --git a/idea/testData/debugger/tinyApp/outs/syntheticMethodsSkip.out b/idea/testData/debugger/tinyApp/outs/syntheticMethodsSkip.out new file mode 100644 index 00000000000..7fffa3da123 --- /dev/null +++ b/idea/testData/debugger/tinyApp/outs/syntheticMethodsSkip.out @@ -0,0 +1,27 @@ +LineBreakpoint created at syntheticMethodsSkip.kt:6 +!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !OUTPUT_PATH!;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! syntheticMethodsSkip.SyntheticMethodsSkipKt +Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' +syntheticMethodsSkip.kt:6 +syntheticMethodsSkip.kt:19 +syntheticMethodsSkip.kt:20 +syntheticMethodsSkip.kt:7 +syntheticMethodsSkip.kt:34 +syntheticMethodsSkip.kt:0 +syntheticMethodsSkip.kt:7 +syntheticMethodsSkip.kt:25 +syntheticMethodsSkip.kt:31 +syntheticMethodsSkip.kt:26 +syntheticMethodsSkip.kt:31 +syntheticMethodsSkip.kt:25 +syntheticMethodsSkip.kt:28 +syntheticMethodsSkip.kt:8 +syntheticMethodsSkip.kt:36 +syntheticMethodsSkip.kt:42 +syntheticMethodsSkip.kt:37 +syntheticMethodsSkip.kt:42 +syntheticMethodsSkip.kt:36 +syntheticMethodsSkip.kt:39 +syntheticMethodsSkip.kt:9 +Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' + +Process finished with exit code 0 diff --git a/idea/testData/debugger/tinyApp/src/stepping/custom/functionCallStoredToVariable.kt b/idea/testData/debugger/tinyApp/src/stepping/custom/functionCallStoredToVariable.kt index c38b6cca015..f090a2733fb 100644 --- a/idea/testData/debugger/tinyApp/src/stepping/custom/functionCallStoredToVariable.kt +++ b/idea/testData/debugger/tinyApp/src/stepping/custom/functionCallStoredToVariable.kt @@ -9,7 +9,7 @@ fun main(args: Array) { // RESUME: 1 val b = simpleFunInt { - // STEP_OVER: 3 + // STEP_OVER: 2 //Breakpoint! 1 } @@ -23,7 +23,7 @@ fun main(args: Array) { // RESUME: 1 val d = simpleFunVoid { - // STEP_OVER: 4 + // STEP_OVER: 3 //Breakpoint! val aa = 1 } diff --git a/idea/testData/debugger/tinyApp/src/stepping/stepInto/syntheticMethodsSkip.kt b/idea/testData/debugger/tinyApp/src/stepping/stepInto/syntheticMethodsSkip.kt new file mode 100644 index 00000000000..d8cecac710b --- /dev/null +++ b/idea/testData/debugger/tinyApp/src/stepping/stepInto/syntheticMethodsSkip.kt @@ -0,0 +1,48 @@ +package syntheticMethodsSkip + +fun main(args: Array) { + val d: Base = Derived() + //Breakpoint! + d.foo("") + A().test() + A.test() +} + +open class Base { + open fun foo(t: T) { + val a = 1 + } +} + +class Derived: Base() { + override fun foo(t: String) { + val a = 1 + } +} + +class A { + fun test() { + lambda { + 1 + } + } + + fun lambda(f: () -> Int): Int { + return f() + } + + companion object { + fun test() { + lambda { + 1 + } + } + + fun lambda(f: () -> Int): Int { + return f() + } + } +} + +// STEP_INTO: 26 +// SKIP_SYNTHETIC_METHODS: true \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinSteppingTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinSteppingTestGenerated.java index 7be712720a7..8f2eb694cac 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinSteppingTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinSteppingTestGenerated.java @@ -265,6 +265,12 @@ public class KotlinSteppingTestGenerated extends AbstractKotlinSteppingTest { doStepIntoTest(fileName); } + @TestMetadata("syntheticMethodsSkip.kt") + public void testSyntheticMethodsSkip() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/stepping/stepInto/syntheticMethodsSkip.kt"); + doStepIntoTest(fileName); + } + @TestMetadata("traits.kt") public void testTraits() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/stepping/stepInto/traits.kt");