Kotlin: make internal constructors' trap labels consistent with the Java extractor

Previously we accidentally named these something like <init>$main, which is a name-mangling the Kotlin compiler applies to internal methods but not to constructors, which look to Java just like regular public constructors.
This commit is contained in:
Chris Smowton
2022-10-21 16:47:14 +01:00
parent 88c6453fa6
commit 00800017fd
5 changed files with 16 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
public class User {
public static void test() { new Test(1, 2); }
}

View File

@@ -0,0 +1 @@
| User.java:3:31:3:44 | new Test(...) | test.kt:3:3:3:51 | { ... } |

View File

@@ -0,0 +1,5 @@
public class Test() {
internal constructor(x: Int, y: Int) : this() { }
}

View File

@@ -0,0 +1,4 @@
import java
from ClassInstanceExpr ce
select ce, ce.getConstructor().getBody()