[FIR TEST] Stabilize top-level extension vs outer member behavior

This commit is contained in:
Mikhail Glukhikh
2020-01-24 10:00:59 +03:00
parent ef8485a232
commit 483ce8bf04
4 changed files with 44 additions and 0 deletions
@@ -0,0 +1,10 @@
fun Outer.Inner.foo() = 42
class Outer {
fun foo() = ""
inner class Inner {
val x = foo() // Should be Int
}
}
@@ -0,0 +1,24 @@
FILE: topExtensionVsOuterMember.kt
public final fun R|Outer.Inner|.foo(): R|kotlin/Int| {
^foo Int(42)
}
public final class Outer : R|kotlin/Any| {
public constructor(): R|Outer| {
super<R|kotlin/Any|>()
}
public final fun foo(): R|kotlin/String| {
^foo String()
}
public final inner class Inner : R|kotlin/Any| {
public constructor(): R|Outer.Inner| {
super<R|kotlin/Any|>()
}
public final val x: R|kotlin/Int| = this@R|/Outer.Inner|.R|/foo|()
public get(): R|kotlin/Int|
}
}
@@ -684,6 +684,11 @@ public class FirDiagnosticsTestGenerated extends AbstractFirDiagnosticsTest {
runTest("compiler/fir/resolve/testData/resolve/expresssions/this.kt");
}
@TestMetadata("topExtensionVsOuterMember.kt")
public void testTopExtensionVsOuterMember() throws Exception {
runTest("compiler/fir/resolve/testData/resolve/expresssions/topExtensionVsOuterMember.kt");
}
@TestMetadata("typeAliasConstructor.kt")
public void testTypeAliasConstructor() throws Exception {
runTest("compiler/fir/resolve/testData/resolve/expresssions/typeAliasConstructor.kt");
@@ -684,6 +684,11 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
runTest("compiler/fir/resolve/testData/resolve/expresssions/this.kt");
}
@TestMetadata("topExtensionVsOuterMember.kt")
public void testTopExtensionVsOuterMember() throws Exception {
runTest("compiler/fir/resolve/testData/resolve/expresssions/topExtensionVsOuterMember.kt");
}
@TestMetadata("typeAliasConstructor.kt")
public void testTypeAliasConstructor() throws Exception {
runTest("compiler/fir/resolve/testData/resolve/expresssions/typeAliasConstructor.kt");