JVM_IR KT-45853 include return type into Java method IdSignature

This is a hack required to accept [potentially] incorrect input
provided by the front-end; see KT-46042.
This commit is contained in:
Dmitry Petrov
2021-04-08 22:29:02 +03:00
committed by TeamCityServer
parent 5ce746f1ec
commit 7e03f8ea80
27 changed files with 299 additions and 70 deletions
+18
View File
@@ -0,0 +1,18 @@
// FILE: kt45853.kt
open class MyProblem() : ThrowableProblem() {
override fun getCause(): Exceptional? = super.cause
}
// FILE: Exceptional.java
public interface Exceptional {
Exceptional getCause();
}
// FILE: ThrowableProblem.java
public abstract class ThrowableProblem extends RuntimeException implements Exceptional {
@Override
public ThrowableProblem getCause() {
// cast is safe, since the only way to set this is our constructor
return (ThrowableProblem) super.getCause();
}
}
+6
View File
@@ -0,0 +1,6 @@
@kotlin.Metadata
public class MyProblem {
// source: 'kt45853.kt'
public method <init>(): void
public @org.jetbrains.annotations.Nullable method getCause(): Exceptional
}
+21
View File
@@ -0,0 +1,21 @@
// FILE: kt45853a.kt
abstract class A {
open val a: A? get() = null
}
class B() : AX() {
override fun getA(): X? = super.a
}
// FILE: X.java
public interface X {
X getA();
}
// FILE: AX.java
public abstract class AX extends A implements X {
@Override
public AX getA() {
return (AX) super.getA();
}
}
+13
View File
@@ -0,0 +1,13 @@
@kotlin.Metadata
public abstract class A {
// source: 'kt45853a.kt'
public method <init>(): void
public @org.jetbrains.annotations.Nullable method getA(): A
}
@kotlin.Metadata
public final class B {
// source: 'kt45853a.kt'
public method <init>(): void
public @org.jetbrains.annotations.Nullable method getA(): X
}