[FIR TEST]: add test with synthetic on Java getter overridden in Kotlin
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
// FILE: Base.java
|
||||
|
||||
public class Base {
|
||||
public String getSomething() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: Derived.kt
|
||||
|
||||
class Derived : Base() {
|
||||
override fun getSomething(): String = "42"
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val d = Derived()
|
||||
val res1 = d.something // Should be Ok
|
||||
val res2 = d.getSomething() // Should be Ok
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
FILE: Derived.kt
|
||||
public final class Derived : R|Base| {
|
||||
public constructor(): R|Derived| {
|
||||
super<R|Base|>()
|
||||
}
|
||||
|
||||
public final override fun getSomething(): R|kotlin/String| {
|
||||
^getSomething String(42)
|
||||
}
|
||||
|
||||
}
|
||||
public final fun test(): R|kotlin/Unit| {
|
||||
lval d: R|Derived| = R|/Derived.Derived|()
|
||||
lval res1: R|ft<kotlin/String, kotlin/String?>!| = R|<local>/d|.R|/Base.something|
|
||||
lval res2: R|kotlin/String| = R|<local>/d|.R|/Derived.getSomething|()
|
||||
}
|
||||
+5
@@ -514,6 +514,11 @@ public class FirDiagnosticsTestGenerated extends AbstractFirDiagnosticsTest {
|
||||
runTest("compiler/fir/resolve/testData/resolve/expresssions/outerObject.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("overriddenJavaGetter.kt")
|
||||
public void testOverriddenJavaGetter() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/expresssions/overriddenJavaGetter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("privateObjectLiteral.kt")
|
||||
public void testPrivateObjectLiteral() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/expresssions/privateObjectLiteral.kt");
|
||||
|
||||
Reference in New Issue
Block a user