Skip to content

Commit 88c4a2f

Browse files
authored
Merge pull request github#10936 from smowton/smowton/fix/internal-constructor-called-from-java
Kotlin: make internal constructors' trap labels consistent with the Java extractor
2 parents 90d4861 + 0080001 commit 88c4a2f

File tree

5 files changed

+16
-1
lines changed

5 files changed

+16
-1
lines changed

java/kotlin-extractor/src/main/kotlin/KotlinUsesExtractor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@ open class KotlinUsesExtractor(
813813
OperatorNameConventions.INVOKE.asString())
814814

815815
fun getSuffixIfInternal() =
816-
if (f.visibility == DescriptorVisibilities.INTERNAL) {
816+
if (f.visibility == DescriptorVisibilities.INTERNAL && f !is IrConstructor) {
817817
"\$" + getJvmModuleName(f)
818818
} else {
819819
""
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public class User {
2+
3+
public static void test() { new Test(1, 2); }
4+
5+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
| User.java:3:31:3:44 | new Test(...) | test.kt:3:3:3:51 | { ... } |
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public class Test() {
2+
3+
internal constructor(x: Int, y: Int) : this() { }
4+
5+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import java
2+
3+
from ClassInstanceExpr ce
4+
select ce, ce.getConstructor().getBody()

0 commit comments

Comments
 (0)