FIR: fix private-to-this corner case with outer class type parameter
Related to KT-49875
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
class A<in T>(t: T) {
|
||||
private val t: T = t // PRIVATE_TO_THIS
|
||||
|
||||
private val i: B = B()
|
||||
|
||||
fun test() {
|
||||
val x: T = t // Ok
|
||||
val y: T = this.t // Ok
|
||||
@@ -11,4 +13,14 @@ class A<in T>(t: T) {
|
||||
fun foo(a: A<String>) {
|
||||
val x: String = a.<!INVISIBLE_REFERENCE!>t<!> // Invisible!
|
||||
}
|
||||
}
|
||||
|
||||
fun bar(a: A<*>) {
|
||||
a.<!INVISIBLE_REFERENCE!>t<!> // Invisible!
|
||||
}
|
||||
|
||||
inner class B {
|
||||
fun baz(a: A<*>) {
|
||||
a.i
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,9 @@ FILE: privateToThis.fir.kt
|
||||
private/*private to this*/ final val t: R|T| = R|<local>/t|
|
||||
private/*private to this*/ get(): R|T|
|
||||
|
||||
private final val i: R|A.B<T>| = this@R|/A|.R|SubstitutionOverride</A.B.B>|()
|
||||
private get(): R|A.B<T>|
|
||||
|
||||
public final fun test(): R|kotlin/Unit| {
|
||||
lval x: R|T| = this@R|/A|.R|/A.t|
|
||||
lval y: R|T| = this@R|/A|.R|/A.t|
|
||||
@@ -16,4 +19,19 @@ FILE: privateToThis.fir.kt
|
||||
lval x: R|kotlin/String| = R|<local>/a|.<HIDDEN: /A.t is invisible>#
|
||||
}
|
||||
|
||||
public final fun bar(a: R|A<*>|): R|kotlin/Unit| {
|
||||
R|<local>/a|.<HIDDEN: /A.t is invisible>#
|
||||
}
|
||||
|
||||
public final inner class B<in T> : R|kotlin/Any| {
|
||||
public A<T>.constructor(): R|A.B<T>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final fun baz(a: R|A<*>|): R|kotlin/Unit| {
|
||||
R|<local>/a|.R|SubstitutionOverride</A.i: R|A.B<CapturedType(*)>|>|
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
class A<in T>(t: T) {
|
||||
private val t: T = t // PRIVATE_TO_THIS
|
||||
|
||||
private val i: B = B()
|
||||
|
||||
fun test() {
|
||||
val x: T = t // Ok
|
||||
val y: T = this.t // Ok
|
||||
@@ -11,4 +13,14 @@ class A<in T>(t: T) {
|
||||
fun foo(a: A<String>) {
|
||||
val x: String = a.<!INVISIBLE_MEMBER!>t<!> // Invisible!
|
||||
}
|
||||
|
||||
fun bar(a: A<*>) {
|
||||
a.<!INVISIBLE_MEMBER!>t<!> // Invisible!
|
||||
}
|
||||
|
||||
inner class B {
|
||||
fun baz(a: A<*>) {
|
||||
a.i
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,20 @@ package
|
||||
|
||||
public final class A</*0*/ in T> {
|
||||
public constructor A</*0*/ in T>(/*0*/ t: T)
|
||||
private final val i: A<T>.B
|
||||
private/*private to this*/ final val t: T
|
||||
public final fun bar(/*0*/ a: A<*>): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final fun foo(/*0*/ a: A<kotlin.String>): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final fun test(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public final inner class B /*captured type parameters: /*0*/ in T*/ {
|
||||
public constructor B()
|
||||
public final fun baz(/*0*/ a: A<*>): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user