[FIR] Rename nested directory with testdata to innerClasses

This is needed to avoid clashing name of generated test class (`Nested`)
  with annotation @Nested from JUnit 5
This commit is contained in:
Dmitriy Novozhilov
2020-11-12 16:23:04 +03:00
parent 419f54259c
commit e3bfb9245c
11 changed files with 99 additions and 99 deletions
@@ -0,0 +1,38 @@
class Owner {
fun foo() {
bar()
this.bar()
}
fun bar() {
val i = Inner()
i.baz()
}
fun err() {}
inner class Inner {
fun baz() {
gau()
this.gau()
}
fun gau() {
val o = Owner()
o.foo()
foo()
this@Owner.foo()
this.<!UNRESOLVED_REFERENCE!>err<!>()
}
}
}
fun test() {
val o = Owner()
o.foo()
val err = Owner.<!UNRESOLVED_REFERENCE!>Inner<!>()
err.<!UNRESOLVED_REFERENCE!>baz<!>()
val i = o.Inner()
i.gau()
}
@@ -0,0 +1,48 @@
FILE: inner.kt
public final class Owner : R|kotlin/Any| {
public constructor(): R|Owner| {
super<R|kotlin/Any|>()
}
public final fun foo(): R|kotlin/Unit| {
this@R|/Owner|.R|/Owner.bar|()
this@R|/Owner|.R|/Owner.bar|()
}
public final fun bar(): R|kotlin/Unit| {
lval i: R|Owner.Inner| = this@R|/Owner|.R|/Owner.Inner.Inner|()
R|<local>/i|.R|/Owner.Inner.baz|()
}
public final fun err(): R|kotlin/Unit| {
}
public final inner class Inner : R|kotlin/Any| {
public constructor(): R|Owner.Inner| {
super<R|kotlin/Any|>()
}
public final fun baz(): R|kotlin/Unit| {
this@R|/Owner.Inner|.R|/Owner.Inner.gau|()
this@R|/Owner.Inner|.R|/Owner.Inner.gau|()
}
public final fun gau(): R|kotlin/Unit| {
lval o: R|Owner| = R|/Owner.Owner|()
R|<local>/o|.R|/Owner.foo|()
this@R|/Owner|.R|/Owner.foo|()
this@R|/Owner|.R|/Owner.foo|()
this@R|/Owner.Inner|.<Unresolved name: err>#()
}
}
}
public final fun test(): R|kotlin/Unit| {
lval o: R|Owner| = R|/Owner.Owner|()
R|<local>/o|.R|/Owner.foo|()
lval err: R|ERROR CLASS: Unresolved name: Inner| = Q|Owner|.<Unresolved name: Inner>#()
R|<local>/err|.<Unresolved name: baz>#()
lval i: R|Owner.Inner| = R|<local>/o|.R|/Owner.Inner.Inner|()
R|<local>/i|.R|/Owner.Inner.gau|()
}
@@ -0,0 +1,15 @@
abstract class A<X : CharSequence> {
inner class Inner
fun foo(x: Inner.() -> Unit) {}
}
object B : A<String>() {
fun bar() {
val y: Inner.() -> Unit = {}
foo(y)
baz(y)
}
}
fun baz(x: (A<String>.Inner) -> Unit) {}
@@ -0,0 +1,34 @@
FILE: innerTypeFromSuperClassInBody.kt
public abstract class A<X : R|kotlin/CharSequence|> : R|kotlin/Any| {
public constructor<X : R|kotlin/CharSequence|>(): R|A<X>| {
super<R|kotlin/Any|>()
}
public final inner class Inner<X : R|kotlin/CharSequence|> : R|kotlin/Any| {
public constructor(): R|A.Inner<X>| {
super<R|kotlin/Any|>()
}
}
public final fun foo(x: R|A.Inner<X>.() -> kotlin/Unit|): R|kotlin/Unit| {
}
}
public final object B : R|A<kotlin/String>| {
private constructor(): R|B| {
super<R|A<kotlin/String>|>()
}
public final fun bar(): R|kotlin/Unit| {
lval y: R|A.Inner<kotlin/String>.() -> kotlin/Unit| = fun R|A.Inner<kotlin/String>|.<anonymous>(): R|kotlin/Unit| {
^ Unit
}
this@R|/B|.R|SubstitutionOverride</B.foo: R|kotlin/Unit|>|(R|<local>/y|)
R|/baz|(R|<local>/y|)
}
}
public final fun baz(x: R|(A.Inner<kotlin/String>) -> kotlin/Unit|): R|kotlin/Unit| {
}
@@ -0,0 +1,21 @@
class Outer<T> {
inner class Inner<K>
}
class Boxed<Q> {
fun substitute() = Outer<Q>().Inner<Int>()
}
fun accept(p: Outer<String>.Inner<Int>) {}
val rr = Outer<String>().Inner<Int>()
val rrq = Boxed<String>().substitute()
fun check() {
<!INAPPLICABLE_CANDIDATE!>accept<!>(Outer<Int>().Inner<Int>()) // illegal
<!INAPPLICABLE_CANDIDATE!>accept<!>(Outer<String>().Inner<String>()) // illegal
accept(Outer<String>().Inner<Int>()) // ok
<!INAPPLICABLE_CANDIDATE!>accept<!>(Boxed<Int>().substitute()) // illegal
accept(Boxed<String>().substitute()) // ok
}
@@ -0,0 +1,37 @@
FILE: innerTypes.kt
public final class Outer<T> : R|kotlin/Any| {
public constructor<T>(): R|Outer<T>| {
super<R|kotlin/Any|>()
}
public final inner class Inner<K, T> : R|kotlin/Any| {
public constructor<K>(): R|Outer.Inner<K, T>| {
super<R|kotlin/Any|>()
}
}
}
public final class Boxed<Q> : R|kotlin/Any| {
public constructor<Q>(): R|Boxed<Q>| {
super<R|kotlin/Any|>()
}
public final fun substitute(): R|Outer.Inner<kotlin/Int, Q>| {
^substitute R|/Outer.Outer|<R|Q|>().R|SubstitutionOverride</Outer.Inner.Inner>|<R|kotlin/Int|>()
}
}
public final fun accept(p: R|Outer.Inner<kotlin/Int, kotlin/String>|): R|kotlin/Unit| {
}
public final val rr: R|Outer.Inner<kotlin/Int, kotlin/String>| = R|/Outer.Outer|<R|kotlin/String|>().R|SubstitutionOverride</Outer.Inner.Inner>|<R|kotlin/Int|>()
public get(): R|Outer.Inner<kotlin/Int, kotlin/String>|
public final val rrq: R|Outer.Inner<kotlin/Int, kotlin/String>| = R|/Boxed.Boxed|<R|kotlin/String|>().R|SubstitutionOverride</Boxed.substitute: R|Outer.Inner<kotlin/Int, kotlin/String>|>|()
public get(): R|Outer.Inner<kotlin/Int, kotlin/String>|
public final fun check(): R|kotlin/Unit| {
<Inapplicable(INAPPLICABLE): /accept>#(R|/Outer.Outer|<R|kotlin/Int|>().R|SubstitutionOverride</Outer.Inner.Inner>|<R|kotlin/Int|>())
<Inapplicable(INAPPLICABLE): /accept>#(R|/Outer.Outer|<R|kotlin/String|>().R|SubstitutionOverride</Outer.Inner.Inner>|<R|kotlin/String|>())
R|/accept|(R|/Outer.Outer|<R|kotlin/String|>().R|SubstitutionOverride</Outer.Inner.Inner>|<R|kotlin/Int|>())
<Inapplicable(INAPPLICABLE): /accept>#(R|/Boxed.Boxed|<R|kotlin/Int|>().R|SubstitutionOverride</Boxed.substitute: R|Outer.Inner<kotlin/Int, kotlin/Int>|>|())
R|/accept|(R|/Boxed.Boxed|<R|kotlin/String|>().R|SubstitutionOverride</Boxed.substitute: R|Outer.Inner<kotlin/Int, kotlin/String>|>|())
}
@@ -0,0 +1,36 @@
class Owner {
fun foo() {
bar()
this.bar()
}
fun bar() {
val n = Nested()
n.baz()
}
class Nested {
fun baz() {
gau()
this.gau()
}
fun gau() {
val o = Owner()
o.foo()
}
fun err() {
<!UNRESOLVED_REFERENCE!>foo<!>()
this.<!UNRESOLVED_REFERENCE!>foo<!>()
}
}
}
fun test() {
val o = Owner()
o.foo()
val n = Owner.Nested()
n.baz()
}
@@ -0,0 +1,45 @@
FILE: simple.kt
public final class Owner : R|kotlin/Any| {
public constructor(): R|Owner| {
super<R|kotlin/Any|>()
}
public final fun foo(): R|kotlin/Unit| {
this@R|/Owner|.R|/Owner.bar|()
this@R|/Owner|.R|/Owner.bar|()
}
public final fun bar(): R|kotlin/Unit| {
lval n: R|Owner.Nested| = R|/Owner.Nested.Nested|()
R|<local>/n|.R|/Owner.Nested.baz|()
}
public final class Nested : R|kotlin/Any| {
public constructor(): R|Owner.Nested| {
super<R|kotlin/Any|>()
}
public final fun baz(): R|kotlin/Unit| {
this@R|/Owner.Nested|.R|/Owner.Nested.gau|()
this@R|/Owner.Nested|.R|/Owner.Nested.gau|()
}
public final fun gau(): R|kotlin/Unit| {
lval o: R|Owner| = R|/Owner.Owner|()
R|<local>/o|.R|/Owner.foo|()
}
public final fun err(): R|kotlin/Unit| {
<Unresolved name: foo>#()
this@R|/Owner.Nested|.<Unresolved name: foo>#()
}
}
}
public final fun test(): R|kotlin/Unit| {
lval o: R|Owner| = R|/Owner.Owner|()
R|<local>/o|.R|/Owner.foo|()
lval n: R|Owner.Nested| = Q|Owner|.R|/Owner.Nested.Nested|()
R|<local>/n|.R|/Owner.Nested.baz|()
}