Mark bridge methods in lambdas classes as synthetic
#KT-10101 Fixed
This commit is contained in:
@@ -275,7 +275,7 @@ public class ClosureCodegen extends MemberCodegen<KtElement> {
|
|||||||
if (bridge.equals(delegate)) return;
|
if (bridge.equals(delegate)) return;
|
||||||
|
|
||||||
MethodVisitor mv =
|
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);
|
bridge.getName(), bridge.getDescriptor(), null, ArrayUtil.EMPTY_STRING_ARRAY);
|
||||||
|
|
||||||
if (state.getClassBuilderMode() != ClassBuilderMode.FULL) return;
|
if (state.getClassBuilderMode() != ClassBuilderMode.FULL) return;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ final class LiteralsKt$foo$1 {
|
|||||||
inner class LiteralsKt$foo$1
|
inner class LiteralsKt$foo$1
|
||||||
method <init>(p0: int): void
|
method <init>(p0: int): void
|
||||||
public final @FunAnn method invoke(): int
|
public final @FunAnn method invoke(): int
|
||||||
public method invoke(): java.lang.Object
|
public synthetic method invoke(): java.lang.Object
|
||||||
}
|
}
|
||||||
|
|
||||||
@kotlin.jvm.internal.KotlinSyntheticClass
|
@kotlin.jvm.internal.KotlinSyntheticClass
|
||||||
@@ -33,7 +33,7 @@ final class LiteralsKt$foo$2 {
|
|||||||
inner class LiteralsKt$foo$2
|
inner class LiteralsKt$foo$2
|
||||||
method <init>(p0: int): void
|
method <init>(p0: int): void
|
||||||
public final method invoke(): int
|
public final method invoke(): int
|
||||||
public method invoke(): java.lang.Object
|
public synthetic method invoke(): java.lang.Object
|
||||||
}
|
}
|
||||||
|
|
||||||
@kotlin.jvm.internal.KotlinLocalClass
|
@kotlin.jvm.internal.KotlinLocalClass
|
||||||
@@ -50,7 +50,7 @@ final class LiteralsKt$foo$x$1 {
|
|||||||
inner class LiteralsKt$foo$x$1
|
inner class LiteralsKt$foo$x$1
|
||||||
method <init>(p0: int): void
|
method <init>(p0: int): void
|
||||||
public final @FunAnn method invoke(): int
|
public final @FunAnn method invoke(): int
|
||||||
public method invoke(): java.lang.Object
|
public synthetic method invoke(): java.lang.Object
|
||||||
}
|
}
|
||||||
|
|
||||||
@kotlin.jvm.internal.KotlinFileFacade
|
@kotlin.jvm.internal.KotlinFileFacade
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socke
|
|||||||
functionCallStoredToVariable.kt:7
|
functionCallStoredToVariable.kt:7
|
||||||
functionCallStoredToVariable.kt:4
|
functionCallStoredToVariable.kt:4
|
||||||
functionCallStoredToVariable.kt:14
|
functionCallStoredToVariable.kt:14
|
||||||
functionCallStoredToVariable.kt:0
|
|
||||||
functionCallStoredToVariable.kt:43
|
functionCallStoredToVariable.kt:43
|
||||||
functionCallStoredToVariable.kt:11
|
functionCallStoredToVariable.kt:11
|
||||||
functionCallStoredToVariable.kt:21
|
functionCallStoredToVariable.kt:21
|
||||||
@@ -15,7 +14,6 @@ functionCallStoredToVariable.kt:22
|
|||||||
functionCallStoredToVariable.kt:18
|
functionCallStoredToVariable.kt:18
|
||||||
functionCallStoredToVariable.kt:28
|
functionCallStoredToVariable.kt:28
|
||||||
functionCallStoredToVariable.kt:29
|
functionCallStoredToVariable.kt:29
|
||||||
functionCallStoredToVariable.kt:0
|
|
||||||
functionCallStoredToVariable.kt:47
|
functionCallStoredToVariable.kt:47
|
||||||
functionCallStoredToVariable.kt:25
|
functionCallStoredToVariable.kt:25
|
||||||
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
|
|||||||
@@ -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
|
||||||
+2
-2
@@ -9,7 +9,7 @@ fun main(args: Array<String>) {
|
|||||||
|
|
||||||
// RESUME: 1
|
// RESUME: 1
|
||||||
val b = simpleFunInt {
|
val b = simpleFunInt {
|
||||||
// STEP_OVER: 3
|
// STEP_OVER: 2
|
||||||
//Breakpoint!
|
//Breakpoint!
|
||||||
1
|
1
|
||||||
}
|
}
|
||||||
@@ -23,7 +23,7 @@ fun main(args: Array<String>) {
|
|||||||
|
|
||||||
// RESUME: 1
|
// RESUME: 1
|
||||||
val d = simpleFunVoid {
|
val d = simpleFunVoid {
|
||||||
// STEP_OVER: 4
|
// STEP_OVER: 3
|
||||||
//Breakpoint!
|
//Breakpoint!
|
||||||
val aa = 1
|
val aa = 1
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package syntheticMethodsSkip
|
||||||
|
|
||||||
|
fun main(args: Array<String>) {
|
||||||
|
val d: Base<String> = Derived()
|
||||||
|
//Breakpoint!
|
||||||
|
d.foo("")
|
||||||
|
A().test()
|
||||||
|
A.test()
|
||||||
|
}
|
||||||
|
|
||||||
|
open class Base<T> {
|
||||||
|
open fun foo(t: T) {
|
||||||
|
val a = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Derived: Base<String>() {
|
||||||
|
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
|
||||||
@@ -265,6 +265,12 @@ public class KotlinSteppingTestGenerated extends AbstractKotlinSteppingTest {
|
|||||||
doStepIntoTest(fileName);
|
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")
|
@TestMetadata("traits.kt")
|
||||||
public void testTraits() throws Exception {
|
public void testTraits() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/stepping/stepInto/traits.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/stepping/stepInto/traits.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user