FIR: Fix type resolution for anonymous objects

^KT-39050 Fixed
This commit is contained in:
Denis Zharkov
2020-05-20 17:57:28 +03:00
parent 4d484dd971
commit be4d3783a4
5 changed files with 87 additions and 8 deletions
@@ -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()
}
}
@@ -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|()
}
}