[FIR TEST]: add test for KT-35730

This commit is contained in:
Mikhail Glukhikh
2019-12-27 13:14:15 +03:00
parent 15f373a864
commit 338281e05f
4 changed files with 37 additions and 0 deletions
@@ -0,0 +1,12 @@
import Derived.foo
interface Base {
fun foo() {}
}
object Derived : Base
fun test() {
// See KT-35730
foo() // Derived.foo is more correct here
}
@@ -0,0 +1,15 @@
FILE: objectOverrideCallViaImport.kt
public abstract interface Base : R|kotlin/Any| {
public open fun foo(): R|kotlin/Unit| {
}
}
public final object Derived : R|Base| {
private constructor(): R|Derived| {
super<R|kotlin/Any|>()
}
}
public final fun test(): R|kotlin/Unit| {
R|/Base.foo|()
}
@@ -539,6 +539,11 @@ public class FirDiagnosticsTestGenerated extends AbstractFirDiagnosticsTest {
runTest("compiler/fir/resolve/testData/resolve/expresssions/nestedVisibility.kt");
}
@TestMetadata("objectOverrideCallViaImport.kt")
public void testObjectOverrideCallViaImport() throws Exception {
runTest("compiler/fir/resolve/testData/resolve/expresssions/objectOverrideCallViaImport.kt");
}
@TestMetadata("objectVsProperty.kt")
public void testObjectVsProperty() throws Exception {
runTest("compiler/fir/resolve/testData/resolve/expresssions/objectVsProperty.kt");
@@ -539,6 +539,11 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
runTest("compiler/fir/resolve/testData/resolve/expresssions/nestedVisibility.kt");
}
@TestMetadata("objectOverrideCallViaImport.kt")
public void testObjectOverrideCallViaImport() throws Exception {
runTest("compiler/fir/resolve/testData/resolve/expresssions/objectOverrideCallViaImport.kt");
}
@TestMetadata("objectVsProperty.kt")
public void testObjectVsProperty() throws Exception {
runTest("compiler/fir/resolve/testData/resolve/expresssions/objectVsProperty.kt");