FIR: Fix type resolution for anonymous objects
^KT-39050 Fixed
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
abstract class Outer {
|
||||
interface Nested {
|
||||
fun bar()
|
||||
}
|
||||
}
|
||||
|
||||
fun main() {
|
||||
object : Outer() {
|
||||
fun foo(n: Nested) {
|
||||
n.bar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class Impl : Outer() {
|
||||
fun foo(n: Nested) {
|
||||
n.bar()
|
||||
}
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
FILE: typesFromSuperClasses.kt
|
||||
public abstract class Outer : R|kotlin/Any| {
|
||||
public constructor(): R|Outer| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public abstract interface Nested : R|kotlin/Any| {
|
||||
public abstract fun bar(): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
public final fun main(): R|kotlin/Unit| {
|
||||
object : R|Outer| {
|
||||
private constructor(): R|anonymous| {
|
||||
super<R|Outer|>()
|
||||
}
|
||||
|
||||
public[local] final fun foo(n: R|Outer.Nested|): R|kotlin/Unit| {
|
||||
R|<local>/n|.R|/Outer.Nested.bar|()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
public final class Impl : R|Outer| {
|
||||
public constructor(): R|Impl| {
|
||||
super<R|Outer|>()
|
||||
}
|
||||
|
||||
public final fun foo(n: R|Outer.Nested|): R|kotlin/Unit| {
|
||||
R|<local>/n|.R|/Outer.Nested.bar|()
|
||||
}
|
||||
|
||||
}
|
||||
Generated
+5
@@ -1481,6 +1481,11 @@ public class FirDiagnosticsTestGenerated extends AbstractFirDiagnosticsTest {
|
||||
public void testImplicitInLocalClasses() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/localClasses/implicitInLocalClasses.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("typesFromSuperClasses.kt")
|
||||
public void testTypesFromSuperClasses() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/localClasses/typesFromSuperClasses.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/fir/analysis-tests/testData/resolve/multifile")
|
||||
|
||||
+5
@@ -1481,6 +1481,11 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
|
||||
public void testImplicitInLocalClasses() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/localClasses/implicitInLocalClasses.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("typesFromSuperClasses.kt")
|
||||
public void testTypesFromSuperClasses() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/localClasses/typesFromSuperClasses.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/fir/analysis-tests/testData/resolve/multifile")
|
||||
|
||||
Reference in New Issue
Block a user