Do not render declarations from other modules in diagnostic tests

Because PackageViewDescriptor may consist of several package fragments from
different modules (see LazyPackageViewDescriptorImpl#fragments), we now filter
out fragments from irrelevant modules before rendering them into the .txt
This commit is contained in:
Alexander Udalov
2016-11-23 23:35:11 +03:00
parent a8bd82e863
commit c1eebacd55
63 changed files with 40 additions and 850 deletions
@@ -42,20 +42,10 @@ package
package a {
public final class b {
// -- Module: <m1> --
}
package a.b {
public final class c {
// -- Module: <m2> --
}
}
}
package test {
public fun test(): kotlin.reflect.KFunction1<a.b.c, kotlin.Unit>
}
@@ -7,7 +7,6 @@ public fun </*0*/ T> bar(/*0*/ ff: [ERROR : Err].() -> kotlin.Unit): kotlin.Unit
// -- Module: <m2> --
package
public fun </*0*/ T> bar(/*0*/ ff: [ERROR : Err].() -> kotlin.Unit): kotlin.Unit
public fun foo(): kotlin.Unit
public final data class User {
@@ -47,22 +47,6 @@ package k2 {
package
package k {
public final class A {
// -- Module: <m1> --
}
internal final class KInternal {
// -- Module: <m1> --
}
private final class KPrivate {
// -- Module: <m1> --
}
public final class KPublic {
// -- Module: <m1> --
}
}
package k2 {
@@ -70,5 +54,3 @@ package k2 {
package k3 {
}
@@ -34,14 +34,6 @@ package
public fun test(/*0*/ b: a.B): kotlin.Unit
package a {
public final class B {
// -- Module: <m1> --
}
public final class B {
// -- Module: <m2> --
}
}
@@ -74,13 +66,3 @@ package
public fun test(/*0*/ b: B): kotlin.Unit
public fun test2(/*0*/ b: B): kotlin.Unit
public final class B {
// -- Module: <top_m1> --
}
public final class B {
// -- Module: <top_m2> --
}
@@ -34,14 +34,6 @@ package
public fun test(/*0*/ b: a.B): kotlin.Unit
package a {
public final class B {
// -- Module: <m1> --
}
public final class B {
// -- Module: <m2> --
}
}
@@ -73,13 +65,3 @@ public final class B {
package
public fun test(/*0*/ b: B): kotlin.Unit
public final class B {
// -- Module: <top_m1> --
}
public final class B {
// -- Module: <top_m2> --
}
@@ -56,20 +56,10 @@ public fun test(/*0*/ a_b: a.b): kotlin.Unit
public fun test2(/*0*/ ab_c: a.b.c): kotlin.Unit
package a {
public fun a_fun(): kotlin.Unit
public fun test(/*0*/ a_b: a.b): kotlin.Unit
public fun test2(/*0*/ ab_c: a.b.c): kotlin.Unit
public final class b {
// -- Module: <m2> --
}
package a.b {
public fun ab_fun(): kotlin.Unit
public final class c {
// -- Module: <m1> --
}
}
}
@@ -81,21 +71,9 @@ public fun test(/*0*/ a_b: a.b): kotlin.Unit
public fun test2(/*0*/ ab_c: a.b.c): kotlin.Unit
package a {
public fun a_fun(): kotlin.Unit
public fun test(/*0*/ a_b: a.b): kotlin.Unit
public fun test2(/*0*/ ab_c: a.b.c): kotlin.Unit
public final class b {
// -- Module: <m2> --
}
package a.b {
public fun ab_fun(): kotlin.Unit
public final class c {
// -- Module: <m1> --
}
}
}
@@ -47,21 +47,9 @@ public final class a {
// -- Module: <m3> --
package
public fun _fun(): kotlin.Unit
public fun test(/*0*/ a_b: a.b): kotlin.Unit
public fun test2(/*0*/ _a: a): kotlin.Unit
public fun test3(/*0*/ _a: a): kotlin.Unit
public final class a {
// -- Module: <m2> --
}
package a {
public fun a_fun(): kotlin.Unit
public final class b {
// -- Module: <m1> --
}
}
@@ -41,17 +41,4 @@ package
public fun test(): kotlin.Unit
package p {
public fun foo(/*0*/ a: p.A<kotlin.Int>): kotlin.Unit
public final class A {
// -- Module: <m1> --
}
public final class A</*0*/ T> {
// -- Module: <m2> --
}
public final class M1 {
// -- Module: <m1> --
}
}
@@ -41,17 +41,4 @@ package
public fun test(): kotlin.Unit
package p {
public fun foo(/*0*/ a: p.A): kotlin.Unit
public final class A {
// -- Module: <m2> --
}
public final class A</*0*/ T> {
// -- Module: <m1> --
}
public final class M1 {
// -- Module: <m1> --
}
}
@@ -42,17 +42,4 @@ package
public fun test(): kotlin.Unit
package p {
public fun foo(/*0*/ a: p.A): kotlin.Unit
public final class A {
// -- Module: <m1> --
}
public final class A {
// -- Module: <m2> --
}
public final class B {
// -- Module: <m1> --
}
}
@@ -151,23 +151,4 @@ package
public fun test(/*0*/ m1: p.M1): kotlin.Unit
package p {
public fun a(/*0*/ p: p.A): kotlin.Unit
public fun b(/*0*/ p: p.A.B): kotlin.Unit
public fun c(/*0*/ p: p.A.C): kotlin.Unit
public fun d(/*0*/ p: p.A.Companion.D): kotlin.Unit
public fun e(/*0*/ p: p.A.Companion.D.E): kotlin.Unit
public fun f(/*0*/ p: p.A.F): kotlin.Unit
public fun g(/*0*/ p: p.A.G): kotlin.Unit
public final class A {
// -- Module: <m1> --
}
public final class A {
// -- Module: <m2> --
}
public final class M1 {
// -- Module: <m1> --
}
}
@@ -46,21 +46,4 @@ package
public fun test(): kotlin.Unit
package p {
public fun foo(/*0*/ a: p.A): kotlin.Unit
public interface A {
// -- Module: <m1> --
}
public interface A {
// -- Module: <m2> --
}
public final class B : p.A {
// -- Module: <m1> --
}
public final class M1 {
// -- Module: <m1> --
}
}
@@ -41,17 +41,4 @@ package
public fun test(): kotlin.Unit
package p {
public fun foo(/*0*/ a: [ERROR : A]<kotlin.Int>): kotlin.Unit
public final class A</*0*/ X, /*1*/ Y> {
// -- Module: <m1> --
}
public final class A</*0*/ X, /*1*/ Y> {
// -- Module: <m2> --
}
public final class M1 {
// -- Module: <m1> --
}
}
@@ -72,39 +72,4 @@ package
public fun test(): kotlin.Unit
package p {
public fun a(/*0*/ a: p.A): kotlin.Unit
public fun c(/*0*/ c: p.C<kotlin.Int>): kotlin.Unit
public fun d(/*0*/ d: p.D<kotlin.Int>): kotlin.Unit
public interface A {
// -- Module: <m2> --
}
public interface A</*0*/ T> {
// -- Module: <m1> --
}
public final class B : p.A<kotlin.Int>, p.C, p.D<kotlin.Int> {
// -- Module: <m1> --
}
public interface C {
// -- Module: <m1> --
}
public interface C</*0*/ T> {
// -- Module: <m2> --
}
public interface D</*0*/ T> {
// -- Module: <m1> --
}
public interface D</*0*/ T> {
// -- Module: <m2> --
}
public final class M1 {
// -- Module: <m1> --
}
}
@@ -26,10 +26,6 @@ package
package p {
public fun test(): kotlin.Unit
public final class A {
// -- Module: <m1> --
}
public final class A {
public constructor A()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
@@ -37,8 +33,4 @@ package p {
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class B {
// -- Module: <m1> --
}
}
@@ -26,10 +26,6 @@ package
package p {
public fun test(): kotlin.Unit
public final class A {
// -- Module: <m1> --
}
public final class A {
public constructor A()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
@@ -37,8 +33,4 @@ package p {
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class B {
// -- Module: <m1> --
}
}
@@ -50,20 +50,4 @@ package
public fun test(/*0*/ a: p.A): kotlin.Unit
package p {
public final class A {
// -- Module: <m1> --
}
public final class A {
// -- Module: <m2> --
}
public final class M1 {
// -- Module: <m1> --
}
public final class M2 {
// -- Module: <m2> --
}
}
@@ -33,12 +33,4 @@ public final class A {
}
package p {
public final class A {
// -- Module: <m1> --
}
public final class B {
// -- Module: <m1> --
}
}
@@ -41,17 +41,4 @@ package
public fun test(): kotlin.Unit
package p {
public fun foo(/*0*/ a: p.A<kotlin.Int>): kotlin.Unit
public final class A</*0*/ T> {
// -- Module: <m1> --
}
public final class A</*0*/ T> {
// -- Module: <m2> --
}
public final class M1 {
// -- Module: <m1> --
}
}
@@ -17,10 +17,6 @@ package
package p {
public interface B</*0*/ T> {
// -- Module: <m1> --
}
public interface C</*0*/ X> : p.B<X> {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract override /*1*/ fun foo(/*0*/ a: X): kotlin.Unit
@@ -50,12 +46,4 @@ package
public fun test(/*0*/ b: p.B<kotlin.String>?): kotlin.Unit
package p {
public interface B</*0*/ T> {
// -- Module: <m3> --
}
public interface C</*0*/ X> : p.B<X> {
// -- Module: <m2> --
}
}
@@ -17,10 +17,6 @@ package
package p {
public interface B</*0*/ T> {
// -- Module: <m1> --
}
public interface C</*0*/ X> : p.B<X> {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract override /*1*/ fun foo(/*0*/ a: X?): kotlin.Unit
@@ -56,16 +52,4 @@ package
public fun test(/*0*/ b: p.B<p.Tr>?): kotlin.Unit
package p {
public interface B</*0*/ T : p.Tr?> {
// -- Module: <m3> --
}
public interface C</*0*/ X> : p.B<X> {
// -- Module: <m2> --
}
public interface Tr {
// -- Module: <m3> --
}
}
@@ -17,10 +17,6 @@ package
package p {
public interface B</*0*/ T, /*1*/ Z> {
// -- Module: <m1> --
}
public interface C</*0*/ X, /*1*/ Z> : p.B<X, Z> {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract override /*1*/ fun foo(/*0*/ a: X?): kotlin.Unit
@@ -50,12 +46,4 @@ package
public fun </*0*/ Y, /*1*/ Z> test(/*0*/ b: p.B<Y, Z>?): kotlin.Unit
package p {
public interface B</*0*/ Z, /*1*/ T> {
// -- Module: <m3> --
}
public interface C</*0*/ X, /*1*/ Z> : p.B<X, Z> {
// -- Module: <m2> --
}
}
@@ -17,10 +17,6 @@ package
package p {
public interface B</*0*/ T> {
// -- Module: <m1> --
}
public interface C</*0*/ X> : p.B<X> {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract override /*1*/ fun foo(/*0*/ a: X): kotlin.Unit
@@ -50,12 +46,4 @@ package
public fun </*0*/ Y> test(/*0*/ b: p.B<Y>?, /*1*/ y: Y): kotlin.Unit
package p {
public interface B</*0*/ T1> {
// -- Module: <m3> --
}
public interface C</*0*/ X> : p.B<X> {
// -- Module: <m2> --
}
}
@@ -17,10 +17,6 @@ package
package p {
public interface B</*0*/ T> {
// -- Module: <m1> --
}
public interface C</*0*/ X> : p.B<X> {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract override /*1*/ fun foo(): X
@@ -50,12 +46,4 @@ package
public fun test(/*0*/ b: p.B<kotlin.String>?): kotlin.Unit
package p {
public interface B</*0*/ T> {
// -- Module: <m3> --
}
public interface C</*0*/ X> : p.B<X> {
// -- Module: <m2> --
}
}
@@ -17,10 +17,6 @@ package
package p {
public interface B</*0*/ T> {
// -- Module: <m1> --
}
public interface C : p.B<kotlin.Any?> {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract override /*1*/ fun </*0*/ R> foo(/*0*/ a: kotlin.Any?, /*1*/ b: R): kotlin.Unit
@@ -50,12 +46,4 @@ package
public fun test(/*0*/ b: p.B?, /*1*/ c: p.C): kotlin.Unit
package p {
public interface B {
// -- Module: <m3> --
}
public interface C : p.B<kotlin.Any?> {
// -- Module: <m2> --
}
}
@@ -17,10 +17,6 @@ package
package p {
public interface B {
// -- Module: <m1> --
}
public interface C : p.B {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract override /*1*/ fun getParent(): p.B?
@@ -50,12 +46,4 @@ package
public fun test(/*0*/ b: p.B?): kotlin.Unit
package p {
public interface B {
// -- Module: <m3> --
}
public interface C : p.B {
// -- Module: <m2> --
}
}
@@ -17,10 +17,6 @@ package
package p {
public interface B {
// -- Module: <m1> --
}
public interface C : p.B {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract override /*1*/ fun foo(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.String): p.B?
@@ -50,12 +46,4 @@ package
public fun test(/*0*/ b: p.B?): kotlin.Unit
package p {
public interface B {
// -- Module: <m3> --
}
public interface C : p.B {
// -- Module: <m2> --
}
}
@@ -28,14 +28,6 @@ package p {
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public interface G1</*0*/ T> {
// -- Module: <m0> --
}
public interface G2</*0*/ A, /*1*/ B> {
// -- Module: <m0> --
}
}
@@ -44,24 +36,12 @@ package
package p {
public interface B {
// -- Module: <m1> --
}
public interface C : p.B {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract override /*1*/ fun foo(/*0*/ a: p.G1<kotlin.Int>?, /*1*/ b: p.G2<p.B, kotlin.String>?): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public interface G1</*0*/ T> {
// -- Module: <m0> --
}
public interface G2</*0*/ A, /*1*/ B> {
// -- Module: <m0> --
}
}
@@ -76,14 +56,6 @@ package p {
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public interface G1</*0*/ T> {
// -- Module: <m0> --
}
public interface G2</*0*/ A, /*1*/ B> {
// -- Module: <m0> --
}
}
@@ -93,20 +65,4 @@ package
public fun test(/*0*/ b: p.B?): kotlin.Unit
package p {
public interface B {
// -- Module: <m3> --
}
public interface C : p.B {
// -- Module: <m2> --
}
public interface G1</*0*/ T> {
// -- Module: <m0> --
}
public interface G2</*0*/ A, /*1*/ B> {
// -- Module: <m0> --
}
}
@@ -17,10 +17,6 @@ package
package p {
public interface B {
// -- Module: <m1> --
}
public interface C : p.B {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract override /*1*/ fun foo(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.String): p.B?
@@ -50,12 +46,4 @@ package
public fun test(/*0*/ b: p.B?): kotlin.Unit
package p {
public interface B {
// -- Module: <m3> --
}
public interface C : p.B {
// -- Module: <m2> --
}
}
@@ -17,10 +17,6 @@ package
package p {
public interface B {
// -- Module: <m1> --
}
public interface C : p.B {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract override /*1*/ fun getParent(): p.B?
@@ -50,12 +46,4 @@ package
public fun test(/*0*/ b: p.B?): kotlin.Unit
package p {
public interface B {
// -- Module: <m3> --
}
public interface C : p.B {
// -- Module: <m2> --
}
}
@@ -17,10 +17,6 @@ package
package p {
public interface B {
// -- Module: <m1> --
}
public final class C : p.B {
public constructor C()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
@@ -51,12 +47,4 @@ package
public fun p.B.test(): kotlin.Unit
package p {
public interface B {
// -- Module: <m3> --
}
public final class C : p.B {
// -- Module: <m2> --
}
}
@@ -17,10 +17,6 @@ package
package p {
public interface B {
// -- Module: <m1> --
}
public interface C : p.B {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract override /*1*/ fun </*0*/ T> foo(/*0*/ a: T): p.B?
@@ -51,12 +47,4 @@ public fun test(/*0*/ b: p.B?): kotlin.Unit
public fun test1(/*0*/ b: p.B?): kotlin.Unit
package p {
public interface B {
// -- Module: <m3> --
}
public interface C : p.B {
// -- Module: <m2> --
}
}
@@ -17,10 +17,6 @@ package
package p {
public interface B {
// -- Module: <m1> --
}
public interface C : p.B {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract override /*1*/ fun </*0*/ T> foo(/*0*/ a: T): p.B?
@@ -56,16 +52,4 @@ package
public fun test(/*0*/ b: p.B?): kotlin.Unit
package p {
public interface B {
// -- Module: <m3> --
}
public interface C : p.B {
// -- Module: <m2> --
}
public interface Tr {
// -- Module: <m3> --
}
}
@@ -17,10 +17,6 @@ package
package p {
public interface B {
// -- Module: <m1> --
}
public interface C : p.B {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract override /*1*/ fun </*0*/ T> foo(/*0*/ a: T): p.B?
@@ -53,12 +49,4 @@ public fun test2(/*0*/ b: p.B?): kotlin.Unit
public fun test3(/*0*/ b: p.B?): kotlin.Unit
package p {
public interface B {
// -- Module: <m3> --
}
public interface C : p.B {
// -- Module: <m2> --
}
}
@@ -17,10 +17,6 @@ package
package p {
public interface B {
// -- Module: <m1> --
}
public interface C : p.B {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract override /*1*/ fun </*0*/ T> foo(/*0*/ a: T): p.B?
@@ -51,12 +47,4 @@ public fun test(/*0*/ b: p.B?): kotlin.Unit
public fun test1(/*0*/ b: p.B?): kotlin.Unit
package p {
public interface B {
// -- Module: <m3> --
}
public interface C : p.B {
// -- Module: <m2> --
}
}
@@ -23,20 +23,12 @@ package
package p {
public interface B {
// -- Module: <m1> --
}
public interface C : p.B {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract override /*1*/ fun </*0*/ T> foo(/*0*/ a: T): p.Foo<T>
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public interface Foo</*0*/ T> {
// -- Module: <m1> --
}
}
@@ -67,16 +59,4 @@ public fun test(/*0*/ b: p.B?): kotlin.Unit
public fun test1(/*0*/ b: p.B?): kotlin.Unit
package p {
public interface B {
// -- Module: <m3> --
}
public interface C : p.B {
// -- Module: <m2> --
}
public interface Foo</*0*/ T> {
// -- Module: <m3> --
}
}
@@ -17,10 +17,6 @@ package
package p {
public interface B {
// -- Module: <m1> --
}
public interface C : p.B {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract override /*1*/ fun </*0*/ T> foo(/*0*/ a: T): T
@@ -51,12 +47,4 @@ public fun test(/*0*/ b: p.B?): kotlin.Unit
public fun test1(/*0*/ b: p.B?): kotlin.Unit
package p {
public interface B {
// -- Module: <m3> --
}
public interface C : p.B {
// -- Module: <m2> --
}
}
@@ -20,6 +20,4 @@ package
public fun test(): kotlin.Unit
package p {
public fun f(/*0*/ s: kotlin.String, /*1*/ t: kotlin.String): kotlin.String
public fun f(/*0*/ s: kotlin.String, /*1*/ t: kotlin.String): kotlin.String
}
@@ -17,10 +17,6 @@ package
package p {
public interface B {
// -- Module: <m1> --
}
public interface C : p.B {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract override /*1*/ fun foo(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.String): p.B?
@@ -50,12 +46,4 @@ package
public fun test(/*0*/ b: p.B?): kotlin.Unit
package p {
public interface B {
// -- Module: <m3> --
}
public interface C : p.B {
// -- Module: <m2> --
}
}
@@ -17,10 +17,6 @@ package
package p {
public interface B {
// -- Module: <m1> --
}
public final class C : p.B {
public constructor C()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
@@ -51,12 +47,4 @@ package
public fun test(/*0*/ b: p.B?): kotlin.Unit
package p {
public interface B {
// -- Module: <m3> --
}
public final class C : p.B {
// -- Module: <m2> --
}
}
@@ -28,14 +28,6 @@ package p {
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public interface G1</*0*/ T> {
// -- Module: <m0> --
}
public interface G2</*0*/ A, /*1*/ B> {
// -- Module: <m0> --
}
}
@@ -44,24 +36,12 @@ package
package p {
public interface B {
// -- Module: <m1> --
}
public interface C : p.B {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract override /*1*/ fun foo(/*0*/ a: p.G1<kotlin.Int>, /*1*/ b: p.G2<p.B, kotlin.String>): p.B?
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public interface G1</*0*/ T> {
// -- Module: <m0> --
}
public interface G2</*0*/ A, /*1*/ B> {
// -- Module: <m0> --
}
}
@@ -76,14 +56,6 @@ package p {
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public interface G1</*0*/ T> {
// -- Module: <m0> --
}
public interface G2</*0*/ A, /*1*/ B> {
// -- Module: <m0> --
}
}
@@ -93,20 +65,4 @@ package
public fun test(/*0*/ b: p.B?, /*1*/ a: p.G1<kotlin.Int>, /*2*/ b1: p.G2<p.B, kotlin.String>): kotlin.Unit
package p {
public interface B {
// -- Module: <m3> --
}
public interface C : p.B {
// -- Module: <m2> --
}
public interface G1</*0*/ T> {
// -- Module: <m0> --
}
public interface G2</*0*/ A, /*1*/ B> {
// -- Module: <m0> --
}
}
@@ -17,10 +17,6 @@ package
package p {
public interface B {
// -- Module: <m1> --
}
public interface C : p.B {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract override /*1*/ fun getParent(): p.B?
@@ -57,16 +53,4 @@ package
public fun test(/*0*/ b: p.B?): kotlin.Unit
package p {
public interface B {
// -- Module: <m3> --
}
public interface C : p.B {
// -- Module: <m2> --
}
public interface D : p.B {
// -- Module: <m3> --
}
}
@@ -21,9 +21,7 @@ public fun test1(): kotlin.Int
public fun test2(): kotlin.Int
package p1 {
@kotlin.SinceKotlin(version = "1.1") public fun foo(/*0*/ s: kotlin.Int): kotlin.String
}
package p2 {
public fun foo(/*0*/ s: kotlin.Int): kotlin.Int
}
@@ -17,10 +17,6 @@ package
package p {
public interface B</*0*/ T> {
// -- Module: <m1> --
}
public interface C : p.B<kotlin.String> {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract override /*1*/ fun foo(/*0*/ a: kotlin.String): kotlin.Unit
@@ -50,12 +46,4 @@ package
public fun test(/*0*/ b: p.B?): kotlin.Unit
package p {
public interface B {
// -- Module: <m3> --
}
public interface C : p.B<kotlin.String> {
// -- Module: <m2> --
}
}
@@ -59,24 +59,4 @@ public final class Foo : p.C, p.B {
}
package p {
public interface A : p.Base {
// -- Module: <m1> --
}
public interface B : p.Base {
// -- Module: <m2> --
}
public interface Base {
// -- Module: <m1> --
}
public interface Base {
// -- Module: <m2> --
}
public interface C : p.A {
// -- Module: <m1> --
}
}
@@ -52,20 +52,4 @@ public final class Foo : p.A, p.B {
}
package p {
public interface A : p.Base {
// -- Module: <m1> --
}
public interface B : p.Base {
// -- Module: <m2> --
}
public interface Base {
// -- Module: <m1> --
}
public interface Base {
// -- Module: <m2> --
}
}
@@ -53,20 +53,4 @@ public final class Foo : p.A, p.B {
}
package p {
public interface A : p.Base {
// -- Module: <m1> --
}
public interface B : p.Base {
// -- Module: <m2> --
}
public interface Base {
// -- Module: <m1> --
}
public interface Base {
// -- Module: <m2> --
}
}
@@ -52,20 +52,4 @@ public final class Foo : p.A<kotlin.String>, p.B {
}
package p {
public interface A</*0*/ T> : p.Base<T> {
// -- Module: <m1> --
}
public interface B : p.Base<kotlin.String> {
// -- Module: <m2> --
}
public interface Base</*0*/ T> {
// -- Module: <m1> --
}
public interface Base</*0*/ T> {
// -- Module: <m2> --
}
}
@@ -35,15 +35,7 @@ public fun test(/*0*/ a: p1.A): kotlin.Unit
public fun test(/*0*/ a: p2.A): kotlin.Unit
package p1 {
@kotlin.Deprecated(level = DeprecationLevel.HIDDEN, message = "Use p2.A instead") public final class A {
// -- Module: <m1> --
}
}
package p2 {
public final class A {
// -- Module: <m2> --
}
}
@@ -50,22 +50,10 @@ public fun test(/*0*/ a: [ERROR : A]): kotlin.Unit
public fun test(/*0*/ a: p2.A): kotlin.Unit
package p1 {
@kotlin.Deprecated(level = DeprecationLevel.HIDDEN, message = "1") public final class A {
// -- Module: <m1> --
}
}
package p2 {
@kotlin.Deprecated(level = DeprecationLevel.HIDDEN, message = "2") public final class A {
// -- Module: <m2> --
}
}
package p3 {
@kotlin.Deprecated(level = DeprecationLevel.HIDDEN, message = "3") public final class A {
// -- Module: <m3> --
}
}
@@ -35,15 +35,7 @@ public fun test(/*0*/ a: p1.A): kotlin.Unit
public fun test(/*0*/ a: p2.A): kotlin.Unit
package p1 {
@kotlin.SinceKotlin(version = "1.1") public final class A {
// -- Module: <m1> --
}
}
package p2 {
public final class A {
// -- Module: <m2> --
}
}
@@ -50,22 +50,10 @@ public fun test(/*0*/ a: [ERROR : A]): kotlin.Unit
public fun test(/*0*/ a: p2.A): kotlin.Unit
package p1 {
@kotlin.SinceKotlin(version = "1.1") public final class A {
// -- Module: <m1> --
}
}
package p2 {
@kotlin.SinceKotlin(version = "1.1") public final class A {
// -- Module: <m2> --
}
}
package p3 {
@kotlin.SinceKotlin(version = "1.1") public final class A {
// -- Module: <m3> --
}
}
@@ -38,17 +38,4 @@ package
public fun test(): kotlin.Unit
package p {
internal val a: p.A
internal var v: p.A
internal fun a(): p.A
public final class A {
// -- Module: <m1> --
}
internal final class B {
// -- Module: <m1> --
}
}
@@ -11,7 +11,5 @@ package p {
package
package p {
private val a: kotlin.Int = 1
public val b: kotlin.Int = 1
public val c: kotlin.Int = 1
}
@@ -24,8 +24,4 @@ package m {
}
package p {
public fun foo(/*0*/ a: kotlin.Int): kotlin.Unit
public fun foo(/*0*/ a: kotlin.Int): kotlin.Unit
public fun foo(/*0*/ vararg values: kotlin.Int /*kotlin.IntArray*/): kotlin.Unit
public fun foo(/*0*/ vararg values: kotlin.Int /*kotlin.IntArray*/): kotlin.Unit
}
@@ -46,15 +46,7 @@ public fun test2(/*0*/ ab_c: a.b.c): kotlin.Unit
package a {
public final class b</*0*/ T> {
// -- Module: <m2> --
}
package a.b {
public final class c {
// -- Module: <m1> --
}
}
}
@@ -100,15 +92,5 @@ package
public fun test(/*0*/ a_b: a.b): kotlin.Unit
public fun test2(/*0*/ _ab: a.b): kotlin.Unit
public final class a</*0*/ T> {
// -- Module: <top_m2> --
}
package a {
public final class b {
// -- Module: <top_m1> --
}
}
@@ -56,18 +56,8 @@ public fun test(/*0*/ a_b: a.b): kotlin.Unit
public fun test2(/*0*/ ab_c: a.b.c): kotlin.Unit
package a {
public fun a_fun(): kotlin.Unit
public final class b {
// -- Module: <_m2> --
}
package a.b {
public fun ab_fun(): kotlin.Unit
public final class c {
// -- Module: <_m1> --
}
}
}
@@ -121,16 +111,7 @@ public fun test(/*0*/ a_b: a.b): kotlin.Unit
public fun test2(/*0*/ ab_c: a.b.c): kotlin.Unit
package a {
public fun a_fun(): kotlin.Unit
public final class b {
// -- Module: <m2> --
}
package a.b {
public final class c {
// -- Module: <m1> --
}
}
}
@@ -31,14 +31,6 @@ package a {
package
package a {
public final class a {
// -- Module: <m1> --
}
public final class b {
// -- Module: <m1> --
}
}
package test {
@@ -57,18 +49,8 @@ package test {
package
package a {
public final class a {
// -- Module: <m1> --
}
public final class b {
// -- Module: <m1> --
}
}
package test {
public fun foo(/*0*/ i: a.a): kotlin.Unit
}
@@ -37,20 +37,10 @@ package
public fun test(/*0*/ _ab: a.b): kotlin.Unit
public final class a {
// -- Module: <m2> --
}
package a {
public fun test(/*0*/ a_b: a.b): kotlin.Unit
public final class b {
// -- Module: <m1> --
}
}
package some {
public fun test(/*0*/ a_b: a.b): kotlin.Unit
}
@@ -39,10 +39,6 @@ package some {
package
package a {
public final class b {
// -- Module: <m1> --
}
}
package other {
@@ -77,8 +73,4 @@ package other2 {
package some {
public fun test(/*0*/ _ab: some.a.b): kotlin.Unit
public final class a {
// -- Module: <m2> --
}
}
@@ -18,10 +18,6 @@ package
package a {
public fun a.X.gav(): kotlin.Int
public final class X {
// -- Module: <m1> --
}
}
package b {
@@ -21,6 +21,7 @@ import org.jetbrains.kotlin.codegen.GenerationUtils
import org.jetbrains.kotlin.codegen.forTestCompile.ForTestCompileRuntime
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.annotations.Annotations
import org.jetbrains.kotlin.descriptors.impl.PackageFragmentDescriptorImpl
import org.jetbrains.kotlin.incremental.components.LookupLocation
import org.jetbrains.kotlin.jvm.compiler.ExpectedLoadErrorsUtil
import org.jetbrains.kotlin.jvm.compiler.LoadDescriptorUtil
@@ -212,6 +213,12 @@ abstract class AbstractJvmRuntimeDescriptorLoaderTest : TestCaseWithTmpdir() {
get() = LoadDescriptorUtil.TEST_PACKAGE_FQNAME
override val memberScope: MemberScope
get() = scope
override val fragments: List<PackageFragmentDescriptor> = listOf(
object : PackageFragmentDescriptorImpl(module, fqName) {
override fun getMemberScope(): MemberScope = scope
}
)
override fun <R, D> accept(visitor: DeclarationDescriptorVisitor<R, D>, data: D): R =
visitor.visitPackageViewDescriptor(this, data)
@@ -222,8 +229,6 @@ abstract class AbstractJvmRuntimeDescriptorLoaderTest : TestCaseWithTmpdir() {
override fun getName() = throw UnsupportedOperationException()
override val annotations: Annotations
get() = throw UnsupportedOperationException()
override val fragments: Nothing
get() = throw UnsupportedOperationException()
}
private class ScopeWithClassifiers(classifiers: List<ClassifierDescriptor>) : MemberScopeImpl() {
@@ -26,17 +26,20 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.builtins.KotlinBuiltIns;
import org.jetbrains.kotlin.descriptors.*;
import org.jetbrains.kotlin.descriptors.impl.SubpackagesScope;
import org.jetbrains.kotlin.jvm.compiler.ExpectedLoadErrorsUtil;
import org.jetbrains.kotlin.name.FqName;
import org.jetbrains.kotlin.renderer.*;
import org.jetbrains.kotlin.resolve.DescriptorUtils;
import org.jetbrains.kotlin.resolve.MemberComparator;
import org.jetbrains.kotlin.resolve.scopes.ChainedMemberScope;
import org.jetbrains.kotlin.resolve.scopes.MemberScope;
import org.jetbrains.kotlin.test.KotlinTestUtils;
import org.jetbrains.kotlin.utils.Printer;
import org.junit.Assert;
import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
@@ -105,6 +108,8 @@ public class RecursiveDescriptorComparator {
@NotNull Printer printer,
boolean topLevel
) {
if (!isFromModule(descriptor, module)) return;
boolean isEnumEntry = isEnumEntry(descriptor);
boolean isClassOrPackage =
(descriptor instanceof ClassOrPackageFragmentDescriptor || descriptor instanceof PackageViewDescriptor) && !isEnumEntry;
@@ -143,7 +148,7 @@ public class RecursiveDescriptorComparator {
}
else if (descriptor instanceof PackageViewDescriptor) {
appendSubDescriptors(descriptor, module,
((PackageViewDescriptor) descriptor).getMemberScope(),
getPackageScopeInModule((PackageViewDescriptor) descriptor, module),
Collections.<DeclarationDescriptor>emptyList(), printer);
}
@@ -176,6 +181,32 @@ public class RecursiveDescriptorComparator {
}
}
@NotNull
private MemberScope getPackageScopeInModule(@NotNull PackageViewDescriptor descriptor, @NotNull ModuleDescriptor module) {
// See LazyPackageViewDescriptorImpl#memberScope
List<MemberScope> scopes = new ArrayList<MemberScope>();
for (PackageFragmentDescriptor fragment : descriptor.getFragments()) {
if (isFromModule(fragment, module)) {
scopes.add(fragment.getMemberScope());
}
}
scopes.add(new SubpackagesScope(module, descriptor.getFqName()));
return ChainedMemberScope.Companion.create("test", scopes);
}
private boolean isFromModule(@NotNull DeclarationDescriptor descriptor, @NotNull ModuleDescriptor module) {
if (conf.renderDeclarationsFromOtherModules) return true;
if (descriptor instanceof PackageViewDescriptor) {
// PackageViewDescriptor does not belong to any module, so we check if one of its containing fragments is in our module
for (PackageFragmentDescriptor fragment : ((PackageViewDescriptor) descriptor).getFragments()) {
if (module.equals(DescriptorUtils.getContainingModule(fragment))) return true;
}
}
return module.equals(DescriptorUtils.getContainingModule(descriptor));
}
private boolean shouldSkip(@NotNull DeclarationDescriptor subDescriptor) {
boolean isFunctionFromAny = subDescriptor.getContainingDeclaration() instanceof ClassDescriptor
&& subDescriptor instanceof FunctionDescriptor
@@ -190,10 +221,7 @@ public class RecursiveDescriptorComparator {
@NotNull Collection<? extends DeclarationDescriptor> extraSubDescriptors,
@NotNull Printer printer
) {
if (!conf.renderDeclarationsFromOtherModules && !module.equals(DescriptorUtils.getContainingModule(descriptor))) {
printer.println(String.format("// -- Module: %s --", DescriptorUtils.getContainingModule(descriptor).getName()));
return;
}
if (!isFromModule(descriptor, module)) return;
List<DeclarationDescriptor> subDescriptors = Lists.newArrayList();