[FIR] Make type parameters inaccessible for non-inner nested types

#KT-57209
This commit is contained in:
Kirill Rakhman
2023-03-14 17:20:35 +01:00
committed by Space Team
parent c39ab956a0
commit 1f0d56e157
24 changed files with 227 additions and 181 deletions
@@ -0,0 +1,39 @@
// SKIP_TXT
class Foo<T> {
companion object {
fun foo(arg: <!UNRESOLVED_REFERENCE!>T<!>) {}
}
object O {
fun foo(arg: <!UNRESOLVED_REFERENCE!>T<!>) {}
}
class Nested {
fun foo(arg: <!UNRESOLVED_REFERENCE!>T<!>) {}
}
inner class Inner<R> {
fun foo(arg1: T, arg2: R) {}
<!NESTED_CLASS_NOT_ALLOWED!>class InnerNested<!> {
fun foo(arg1: <!UNRESOLVED_REFERENCE!>T<!>, arg2: <!UNRESOLVED_REFERENCE!>R<!>) {}
}
}
enum class E {
;
fun foo(arg: <!UNRESOLVED_REFERENCE!>T<!>) {}
}
val obj = object {
fun foo(arg: T) {}
}
fun <R> bar() {
class Local {
fun baz(arg1: T, arg2: R) {}
}
}
}
@@ -0,0 +1,39 @@
// SKIP_TXT
class Foo<T> {
companion object {
fun foo(arg: <!UNRESOLVED_REFERENCE!>T<!>) {}
}
object O {
fun foo(arg: <!UNRESOLVED_REFERENCE!>T<!>) {}
}
class Nested {
fun foo(arg: <!UNRESOLVED_REFERENCE!>T<!>) {}
}
inner class Inner<R> {
fun foo(arg1: T, arg2: R) {}
<!NESTED_CLASS_NOT_ALLOWED!>class InnerNested<!> {
fun foo(arg1: <!INACCESSIBLE_OUTER_CLASS_EXPRESSION!>T<!>, arg2: <!UNRESOLVED_REFERENCE!>R<!>) {}
}
}
enum class E {
;
fun foo(arg: <!UNRESOLVED_REFERENCE!>T<!>) {}
}
val obj = object {
fun foo(arg: T) {}
}
fun <R> bar() {
class Local {
fun baz(arg1: T, arg2: R) {}
}
}
}