[FIR] Move check for _private-to-this_ visibility into checker
^KT-55446 ^KT-65790 Fixed
This commit is contained in:
committed by
Space Team
parent
5fe1e0c1a5
commit
c64575f4a2
@@ -1,5 +1,6 @@
|
||||
// FIR_DUMP
|
||||
|
||||
// explicit types
|
||||
class A<in T>(t: T) {
|
||||
private val t: T = t // PRIVATE_TO_THIS
|
||||
|
||||
@@ -24,3 +25,13 @@ class A<in T>(t: T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// implicit types
|
||||
class C<in T>(t: T) {
|
||||
private val t: T = t
|
||||
private val tt = t
|
||||
|
||||
fun foo(a: C<String>) {
|
||||
val x: String = a.<!INVISIBLE_REFERENCE!>tt<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@ FILE: privateToThis.fir.kt
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
private/*private to this*/ final val t: R|T| = R|<local>/t|
|
||||
private/*private to this*/ get(): R|T|
|
||||
private final val t: R|T| = R|<local>/t|
|
||||
private 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>|
|
||||
@@ -16,11 +16,11 @@ FILE: privateToThis.fir.kt
|
||||
}
|
||||
|
||||
public final fun foo(a: R|A<kotlin/String>|): R|kotlin/Unit| {
|
||||
lval x: R|kotlin/String| = R|<local>/a|.R|SubstitutionOverride</A.t: R|kotlin/String|><HIDDEN: /A.t is invisible>#|
|
||||
lval x: R|kotlin/String| = R|<local>/a|.R|SubstitutionOverride</A.t: R|kotlin/String|>|
|
||||
}
|
||||
|
||||
public final fun bar(a: R|A<*>|): R|kotlin/Unit| {
|
||||
R|<local>/a|.R|SubstitutionOverride</A.t: R|CapturedType(*)|><HIDDEN: /A.t is invisible>#|
|
||||
R|<local>/a|.R|SubstitutionOverride</A.t: R|CapturedType(*)|>|
|
||||
}
|
||||
|
||||
public final inner class B<in Outer(T)> : R|kotlin/Any| {
|
||||
@@ -35,3 +35,19 @@ FILE: privateToThis.fir.kt
|
||||
}
|
||||
|
||||
}
|
||||
public final class C<in T> : R|kotlin/Any| {
|
||||
public constructor<in T>(t: R|T|): R|C<T>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
private final val t: R|T| = R|<local>/t|
|
||||
private get(): R|T|
|
||||
|
||||
private final val tt: R|T| = R|<local>/t|
|
||||
private get(): R|T|
|
||||
|
||||
public final fun foo(a: R|C<kotlin/String>|): R|kotlin/Unit| {
|
||||
lval x: R|kotlin/String| = R|<local>/a|.R|SubstitutionOverride</C.tt: R|kotlin/String|>|
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// FIR_DUMP
|
||||
|
||||
// explicit types
|
||||
class A<in T>(t: T) {
|
||||
private val t: T = t // PRIVATE_TO_THIS
|
||||
|
||||
@@ -24,3 +25,13 @@ class A<in T>(t: T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// implicit types
|
||||
class C<in T>(t: T) {
|
||||
private val t: T = t
|
||||
private val tt = t
|
||||
|
||||
fun foo(a: C<String>) {
|
||||
val x: String = a.<!INVISIBLE_MEMBER!>tt<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,3 +19,14 @@ public final class A</*0*/ in T> {
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
public final class C</*0*/ in T> {
|
||||
public constructor C</*0*/ in T>(/*0*/ t: T)
|
||||
private/*private to this*/ final val t: T
|
||||
private/*private to this*/ final val tt: T
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final fun foo(/*0*/ a: C<kotlin.String>): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ class Foo<in T> : Base<<!TYPE_VARIANCE_CONFLICT_ERROR!>T<!>>() {
|
||||
|
||||
fun bar(f: Foo<Bar>) {
|
||||
val dnn = f.<!INVISIBLE_REFERENCE!>dnn<!>
|
||||
// This case (and any other with non-denotable type) requires KT-55446 to be fixed
|
||||
val flex = f.flex
|
||||
val flex = f.<!INVISIBLE_REFERENCE!>flex<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ class Foo<in T> : Base<<!TYPE_VARIANCE_CONFLICT_ERROR!>T<!>>() {
|
||||
|
||||
fun bar(f: Foo<Bar>) {
|
||||
val dnn = f.<!INVISIBLE_MEMBER!>dnn<!>
|
||||
// This case (and any other with non-denotable type) requires KT-55446 to be fixed
|
||||
val flex = f.<!INVISIBLE_MEMBER!>flex<!>
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user