From c1eebacd55d08b019a6cea4b6ab98fb13cb244d4 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Wed, 23 Nov 2016 23:35:11 +0300 Subject: [PATCH] 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 --- .../callableReference/classVsPackage.txt | 10 ----- .../ea81649_errorPropertyLHS.txt | 1 - .../tests/imports/CheckVisibility.txt | 18 -------- .../diagnostics/tests/imports/ClassClash.txt | 18 -------- .../tests/imports/ClassClashStarImport.txt | 18 -------- .../tests/imports/PackageVsClass.txt | 22 ---------- .../tests/imports/TopLevelClassVsPackage.txt | 12 ----- .../differentGenericArguments.txt | 13 ------ .../differentGenericArgumentsReversed.txt | 13 ------ .../duplicateClass/duplicateClass.txt | 13 ------ .../duplicateClass/duplicateNestedClasses.txt | 19 -------- .../duplicateClass/duplicateSuperClass.txt | 17 ------- .../genericArgumentNumberMismatch.txt | 13 ------ .../duplicateClass/genericSuperClass.txt | 35 --------------- .../inTheSameModuleWithUsage.txt | 8 ---- ...TheSameModuleWithUsageNoTypeAnnotation.txt | 8 ---- .../multimodule/duplicateClass/members.txt | 16 ------- .../sameClassNameDifferentPackages.txt | 8 ---- .../duplicateClass/sameGenericArguments.txt | 13 ------ .../duplicateMethod/classGenericsInParams.txt | 12 ----- .../classGenericsInParamsBoundMismatch.txt | 16 ------- .../classGenericsInParamsIndexMismatch.txt | 12 ----- .../classGenericsInParamsNameMismatch.txt | 12 ----- .../classGenericsInReturnType.txt | 12 ----- ...lassVsFunctionGenericsInParamsMismatch.txt | 12 ----- .../duplicateMethod/covariantReturnTypes.txt | 12 ----- .../differenceInParamNames.txt | 12 ----- .../differentGenericsInParams.txt | 44 ------------------- .../differentNumberOfParams.txt | 12 ----- .../duplicateMethod/differentReturnTypes.txt | 12 ----- .../duplicateMethod/extensionMatch.txt | 12 ----- .../functionGenericsInParams.txt | 12 ----- ...functionGenericsInParamsBoundsMismatch.txt | 16 ------- .../functionGenericsInParamsEqNull.txt | 12 ----- .../functionGenericsInParamsNotIs.txt | 12 ----- .../functionGenericsInParamsReturnFooT.txt | 20 --------- .../functionGenericsInParamsReturnT.txt | 12 ----- .../incompleteCodeNoNoneApplicable.txt | 2 - .../duplicateMethod/noGenericsInParams.txt | 12 ----- .../multimodule/duplicateMethod/noParams.txt | 12 ----- .../duplicateMethod/sameGenericsInParams.txt | 44 ------------------- .../duplicateMethod/simpleWithInheritance.txt | 16 ------- .../duplicateMethod/sinceKotlin.txt | 2 - .../substitutedGenericInParams.txt | 12 ----- .../duplicateSuper/differentSuperTraits.txt | 20 --------- .../duplicateSuper/sameSuperTrait.txt | 16 ------- .../sameSuperTraitDifferentBounds.txt | 16 ------- .../duplicateSuper/sameSuperTraitGenerics.txt | 16 ------- .../deprecatedHiddenImportPriority.txt | 8 ---- .../deprecatedHiddenMultipleClasses.txt | 12 ----- .../hiddenClass/sinceKotlinImportPriority.txt | 8 ---- .../sinceKotlinMultipleClasses.txt | 12 ----- .../tests/multimodule/internal.txt | 13 ------ .../tests/multimodule/packagePrivate.txt | 2 - .../tests/multimodule/varargConflict.txt | 4 -- .../GenericClassVsPackage.txt | 18 -------- .../qualifiedExpression/PackageVsClass.txt | 19 -------- .../qualifiedExpression/PackageVsClass2.txt | 18 -------- .../PackageVsRootClass.txt | 10 ----- .../visibleClassVsQualifiedClass.txt | 8 ---- .../smartCasts/publicVals/otherModule.txt | 4 -- .../AbstractJvmRuntimeDescriptorLoaderTest.kt | 9 +++- .../util/RecursiveDescriptorComparator.java | 38 +++++++++++++--- 63 files changed, 40 insertions(+), 850 deletions(-) diff --git a/compiler/testData/diagnostics/tests/callableReference/classVsPackage.txt b/compiler/testData/diagnostics/tests/callableReference/classVsPackage.txt index 3eda9d000c5..a7f8c68bc42 100644 --- a/compiler/testData/diagnostics/tests/callableReference/classVsPackage.txt +++ b/compiler/testData/diagnostics/tests/callableReference/classVsPackage.txt @@ -42,20 +42,10 @@ package package a { - public final class b { - // -- Module: -- - } - package a.b { - - public final class c { - // -- Module: -- - } } } package test { public fun test(): kotlin.reflect.KFunction1 } - - diff --git a/compiler/testData/diagnostics/tests/callableReference/ea81649_errorPropertyLHS.txt b/compiler/testData/diagnostics/tests/callableReference/ea81649_errorPropertyLHS.txt index 718354477af..c144a6cd26b 100644 --- a/compiler/testData/diagnostics/tests/callableReference/ea81649_errorPropertyLHS.txt +++ b/compiler/testData/diagnostics/tests/callableReference/ea81649_errorPropertyLHS.txt @@ -7,7 +7,6 @@ public fun bar(/*0*/ ff: [ERROR : Err].() -> kotlin.Unit): kotlin.Unit // -- Module: -- package -public fun bar(/*0*/ ff: [ERROR : Err].() -> kotlin.Unit): kotlin.Unit public fun foo(): kotlin.Unit public final data class User { diff --git a/compiler/testData/diagnostics/tests/imports/CheckVisibility.txt b/compiler/testData/diagnostics/tests/imports/CheckVisibility.txt index 426a19aed45..38a3307333f 100644 --- a/compiler/testData/diagnostics/tests/imports/CheckVisibility.txt +++ b/compiler/testData/diagnostics/tests/imports/CheckVisibility.txt @@ -47,22 +47,6 @@ package k2 { package package k { - - public final class A { - // -- Module: -- - } - - internal final class KInternal { - // -- Module: -- - } - - private final class KPrivate { - // -- Module: -- - } - - public final class KPublic { - // -- Module: -- - } } package k2 { @@ -70,5 +54,3 @@ package k2 { package k3 { } - - diff --git a/compiler/testData/diagnostics/tests/imports/ClassClash.txt b/compiler/testData/diagnostics/tests/imports/ClassClash.txt index 3248f3d00af..c2ba9b521e8 100644 --- a/compiler/testData/diagnostics/tests/imports/ClassClash.txt +++ b/compiler/testData/diagnostics/tests/imports/ClassClash.txt @@ -34,14 +34,6 @@ package public fun test(/*0*/ b: a.B): kotlin.Unit package a { - - public final class B { - // -- Module: -- - } - - public final class B { - // -- Module: -- - } } @@ -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: -- -} - -public final class B { - // -- Module: -- -} - - diff --git a/compiler/testData/diagnostics/tests/imports/ClassClashStarImport.txt b/compiler/testData/diagnostics/tests/imports/ClassClashStarImport.txt index 24d52ca4f3c..67eb8dbf8ce 100644 --- a/compiler/testData/diagnostics/tests/imports/ClassClashStarImport.txt +++ b/compiler/testData/diagnostics/tests/imports/ClassClashStarImport.txt @@ -34,14 +34,6 @@ package public fun test(/*0*/ b: a.B): kotlin.Unit package a { - - public final class B { - // -- Module: -- - } - - public final class B { - // -- Module: -- - } } @@ -73,13 +65,3 @@ public final class B { package public fun test(/*0*/ b: B): kotlin.Unit - -public final class B { - // -- Module: -- -} - -public final class B { - // -- Module: -- -} - - diff --git a/compiler/testData/diagnostics/tests/imports/PackageVsClass.txt b/compiler/testData/diagnostics/tests/imports/PackageVsClass.txt index 55a6aa63adf..62e353c247f 100644 --- a/compiler/testData/diagnostics/tests/imports/PackageVsClass.txt +++ b/compiler/testData/diagnostics/tests/imports/PackageVsClass.txt @@ -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: -- - } - package a.b { - public fun ab_fun(): kotlin.Unit - - public final class c { - // -- Module: -- - } } } @@ -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: -- - } - package a.b { - public fun ab_fun(): kotlin.Unit - - public final class c { - // -- Module: -- - } } } - - diff --git a/compiler/testData/diagnostics/tests/imports/TopLevelClassVsPackage.txt b/compiler/testData/diagnostics/tests/imports/TopLevelClassVsPackage.txt index fed0172e891..23593f3b204 100644 --- a/compiler/testData/diagnostics/tests/imports/TopLevelClassVsPackage.txt +++ b/compiler/testData/diagnostics/tests/imports/TopLevelClassVsPackage.txt @@ -47,21 +47,9 @@ public final class a { // -- Module: -- 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: -- -} - package a { - public fun a_fun(): kotlin.Unit - - public final class b { - // -- Module: -- - } } - - diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/differentGenericArguments.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/differentGenericArguments.txt index beeec349b52..fcd07071bda 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/differentGenericArguments.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/differentGenericArguments.txt @@ -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: -- - } - - public final class A { - // -- Module: -- - } - - public final class M1 { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/differentGenericArgumentsReversed.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/differentGenericArgumentsReversed.txt index 4704d1d0393..7f3dee5313b 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/differentGenericArgumentsReversed.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/differentGenericArgumentsReversed.txt @@ -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: -- - } - - public final class A { - // -- Module: -- - } - - public final class M1 { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/duplicateClass.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/duplicateClass.txt index b65c7d51d23..4dc3decd662 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/duplicateClass.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/duplicateClass.txt @@ -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: -- - } - - public final class A { - // -- Module: -- - } - - public final class B { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/duplicateNestedClasses.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/duplicateNestedClasses.txt index 0508b34591a..1429569ba99 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/duplicateNestedClasses.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/duplicateNestedClasses.txt @@ -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: -- - } - - public final class A { - // -- Module: -- - } - - public final class M1 { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/duplicateSuperClass.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/duplicateSuperClass.txt index ecefd82f117..2e54f268a65 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/duplicateSuperClass.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/duplicateSuperClass.txt @@ -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: -- - } - - public interface A { - // -- Module: -- - } - - public final class B : p.A { - // -- Module: -- - } - - public final class M1 { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/genericArgumentNumberMismatch.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/genericArgumentNumberMismatch.txt index f58a2ff6170..f4a73715877 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/genericArgumentNumberMismatch.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/genericArgumentNumberMismatch.txt @@ -41,17 +41,4 @@ package public fun test(): kotlin.Unit package p { - public fun foo(/*0*/ a: [ERROR : A]): kotlin.Unit - - public final class A { - // -- Module: -- - } - - public final class A { - // -- Module: -- - } - - public final class M1 { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/genericSuperClass.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/genericSuperClass.txt index 7034b55178b..f7b45a825c1 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/genericSuperClass.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/genericSuperClass.txt @@ -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.Unit - public fun d(/*0*/ d: p.D): kotlin.Unit - - public interface A { - // -- Module: -- - } - - public interface A { - // -- Module: -- - } - - public final class B : p.A, p.C, p.D { - // -- Module: -- - } - - public interface C { - // -- Module: -- - } - - public interface C { - // -- Module: -- - } - - public interface D { - // -- Module: -- - } - - public interface D { - // -- Module: -- - } - - public final class M1 { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/inTheSameModuleWithUsage.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/inTheSameModuleWithUsage.txt index 87e7d6a07db..6c3bb54b64a 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/inTheSameModuleWithUsage.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/inTheSameModuleWithUsage.txt @@ -26,10 +26,6 @@ package package p { public fun test(): kotlin.Unit - public final class A { - // -- Module: -- - } - 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: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/inTheSameModuleWithUsageNoTypeAnnotation.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/inTheSameModuleWithUsageNoTypeAnnotation.txt index 87e7d6a07db..6c3bb54b64a 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/inTheSameModuleWithUsageNoTypeAnnotation.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/inTheSameModuleWithUsageNoTypeAnnotation.txt @@ -26,10 +26,6 @@ package package p { public fun test(): kotlin.Unit - public final class A { - // -- Module: -- - } - 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: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/members.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/members.txt index 854332f2013..39fa3dccfd9 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/members.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/members.txt @@ -50,20 +50,4 @@ package public fun test(/*0*/ a: p.A): kotlin.Unit package p { - - public final class A { - // -- Module: -- - } - - public final class A { - // -- Module: -- - } - - public final class M1 { - // -- Module: -- - } - - public final class M2 { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/sameClassNameDifferentPackages.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/sameClassNameDifferentPackages.txt index 05f7c94ca73..61772be459a 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/sameClassNameDifferentPackages.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/sameClassNameDifferentPackages.txt @@ -33,12 +33,4 @@ public final class A { } package p { - - public final class A { - // -- Module: -- - } - - public final class B { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/sameGenericArguments.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/sameGenericArguments.txt index fd4c6249e39..648e84de086 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/sameGenericArguments.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/sameGenericArguments.txt @@ -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: -- - } - - public final class A { - // -- Module: -- - } - - public final class M1 { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParams.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParams.txt index f028d8b27d6..5411840cc8a 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParams.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParams.txt @@ -17,10 +17,6 @@ package package p { - public interface B { - // -- Module: -- - } - 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: X): kotlin.Unit @@ -50,12 +46,4 @@ package public fun test(/*0*/ b: p.B?): kotlin.Unit package p { - - public interface B { - // -- Module: -- - } - - public interface C : p.B { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParamsBoundMismatch.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParamsBoundMismatch.txt index 8983a6f691a..08886c16a9e 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParamsBoundMismatch.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParamsBoundMismatch.txt @@ -17,10 +17,6 @@ package package p { - public interface B { - // -- Module: -- - } - 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: X?): kotlin.Unit @@ -56,16 +52,4 @@ package public fun test(/*0*/ b: p.B?): kotlin.Unit package p { - - public interface B { - // -- Module: -- - } - - public interface C : p.B { - // -- Module: -- - } - - public interface Tr { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParamsIndexMismatch.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParamsIndexMismatch.txt index b1d840e026d..5073661fe33 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParamsIndexMismatch.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParamsIndexMismatch.txt @@ -17,10 +17,6 @@ package package p { - public interface B { - // -- Module: -- - } - 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: X?): kotlin.Unit @@ -50,12 +46,4 @@ package public fun test(/*0*/ b: p.B?): kotlin.Unit package p { - - public interface B { - // -- Module: -- - } - - public interface C : p.B { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParamsNameMismatch.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParamsNameMismatch.txt index e55f760f5d9..156a4501fca 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParamsNameMismatch.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParamsNameMismatch.txt @@ -17,10 +17,6 @@ package package p { - public interface B { - // -- Module: -- - } - 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: X): kotlin.Unit @@ -50,12 +46,4 @@ package public fun test(/*0*/ b: p.B?, /*1*/ y: Y): kotlin.Unit package p { - - public interface B { - // -- Module: -- - } - - public interface C : p.B { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInReturnType.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInReturnType.txt index f003d2ee55f..894fb64e2cd 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInReturnType.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInReturnType.txt @@ -17,10 +17,6 @@ package package p { - public interface B { - // -- Module: -- - } - 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(): X @@ -50,12 +46,4 @@ package public fun test(/*0*/ b: p.B?): kotlin.Unit package p { - - public interface B { - // -- Module: -- - } - - public interface C : p.B { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classVsFunctionGenericsInParamsMismatch.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classVsFunctionGenericsInParamsMismatch.txt index 7dce7a73b70..ef455ee955b 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classVsFunctionGenericsInParamsMismatch.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classVsFunctionGenericsInParamsMismatch.txt @@ -17,10 +17,6 @@ package package p { - public interface B { - // -- Module: -- - } - 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.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: -- - } - - public interface C : p.B { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/covariantReturnTypes.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/covariantReturnTypes.txt index c1e0c8a908d..c4cde35c130 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/covariantReturnTypes.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/covariantReturnTypes.txt @@ -17,10 +17,6 @@ package package p { - public interface B { - // -- Module: -- - } - 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: -- - } - - public interface C : p.B { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/differenceInParamNames.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/differenceInParamNames.txt index 12ff6897663..5b0ae7b8dce 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/differenceInParamNames.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/differenceInParamNames.txt @@ -17,10 +17,6 @@ package package p { - public interface B { - // -- Module: -- - } - 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: -- - } - - public interface C : p.B { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/differentGenericsInParams.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/differentGenericsInParams.txt index 089d32e7498..ae3ff0ee35d 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/differentGenericsInParams.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/differentGenericsInParams.txt @@ -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 { - // -- Module: -- - } - - public interface G2 { - // -- Module: -- - } } @@ -44,24 +36,12 @@ package package p { - public interface B { - // -- Module: -- - } - 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?, /*1*/ b: p.G2?): 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 { - // -- Module: -- - } - - public interface G2 { - // -- Module: -- - } } @@ -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 { - // -- Module: -- - } - - public interface G2 { - // -- Module: -- - } } @@ -93,20 +65,4 @@ package public fun test(/*0*/ b: p.B?): kotlin.Unit package p { - - public interface B { - // -- Module: -- - } - - public interface C : p.B { - // -- Module: -- - } - - public interface G1 { - // -- Module: -- - } - - public interface G2 { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/differentNumberOfParams.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/differentNumberOfParams.txt index ccb06ec16ad..8ccd10e3a60 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/differentNumberOfParams.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/differentNumberOfParams.txt @@ -17,10 +17,6 @@ package package p { - public interface B { - // -- Module: -- - } - 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: -- - } - - public interface C : p.B { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/differentReturnTypes.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/differentReturnTypes.txt index fee6341b3d6..1eb3eb93a07 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/differentReturnTypes.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/differentReturnTypes.txt @@ -17,10 +17,6 @@ package package p { - public interface B { - // -- Module: -- - } - 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: -- - } - - public interface C : p.B { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/extensionMatch.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/extensionMatch.txt index 38172e95400..ec178199538 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/extensionMatch.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/extensionMatch.txt @@ -17,10 +17,6 @@ package package p { - public interface B { - // -- Module: -- - } - 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: -- - } - - public final class C : p.B { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParams.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParams.txt index b694d72e13b..47383d5c6f4 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParams.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParams.txt @@ -17,10 +17,6 @@ package package p { - public interface B { - // -- Module: -- - } - 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: 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: -- - } - - public interface C : p.B { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsBoundsMismatch.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsBoundsMismatch.txt index 5b2c2491ac0..fd873bda6a5 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsBoundsMismatch.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsBoundsMismatch.txt @@ -17,10 +17,6 @@ package package p { - public interface B { - // -- Module: -- - } - 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: T): p.B? @@ -56,16 +52,4 @@ package public fun test(/*0*/ b: p.B?): kotlin.Unit package p { - - public interface B { - // -- Module: -- - } - - public interface C : p.B { - // -- Module: -- - } - - public interface Tr { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsEqNull.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsEqNull.txt index c467416b4c9..424fd535424 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsEqNull.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsEqNull.txt @@ -17,10 +17,6 @@ package package p { - public interface B { - // -- Module: -- - } - 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: 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: -- - } - - public interface C : p.B { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsNotIs.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsNotIs.txt index b694d72e13b..47383d5c6f4 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsNotIs.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsNotIs.txt @@ -17,10 +17,6 @@ package package p { - public interface B { - // -- Module: -- - } - 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: 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: -- - } - - public interface C : p.B { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsReturnFooT.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsReturnFooT.txt index 40e1d99af20..1f2ad8f40e1 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsReturnFooT.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsReturnFooT.txt @@ -23,20 +23,12 @@ package package p { - public interface B { - // -- Module: -- - } - 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: T): p.Foo public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } - - public interface Foo { - // -- Module: -- - } } @@ -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: -- - } - - public interface C : p.B { - // -- Module: -- - } - - public interface Foo { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsReturnT.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsReturnT.txt index 1f1efbc6181..6c996973c4e 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsReturnT.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsReturnT.txt @@ -17,10 +17,6 @@ package package p { - public interface B { - // -- Module: -- - } - 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: 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: -- - } - - public interface C : p.B { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/incompleteCodeNoNoneApplicable.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/incompleteCodeNoNoneApplicable.txt index 53cc4ec4697..e21ba77ddb8 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/incompleteCodeNoNoneApplicable.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/incompleteCodeNoNoneApplicable.txt @@ -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 } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/noGenericsInParams.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/noGenericsInParams.txt index fde69e9e0b6..cec6fb5264b 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/noGenericsInParams.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/noGenericsInParams.txt @@ -17,10 +17,6 @@ package package p { - public interface B { - // -- Module: -- - } - 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: -- - } - - public interface C : p.B { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/noParams.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/noParams.txt index 1d70f04538e..0077e18de0c 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/noParams.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/noParams.txt @@ -17,10 +17,6 @@ package package p { - public interface B { - // -- Module: -- - } - 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: -- - } - - public final class C : p.B { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/sameGenericsInParams.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/sameGenericsInParams.txt index e8c26a7bf41..114746edace 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/sameGenericsInParams.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/sameGenericsInParams.txt @@ -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 { - // -- Module: -- - } - - public interface G2 { - // -- Module: -- - } } @@ -44,24 +36,12 @@ package package p { - public interface B { - // -- Module: -- - } - 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, /*1*/ b: p.G2): 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 { - // -- Module: -- - } - - public interface G2 { - // -- Module: -- - } } @@ -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 { - // -- Module: -- - } - - public interface G2 { - // -- Module: -- - } } @@ -93,20 +65,4 @@ package public fun test(/*0*/ b: p.B?, /*1*/ a: p.G1, /*2*/ b1: p.G2): kotlin.Unit package p { - - public interface B { - // -- Module: -- - } - - public interface C : p.B { - // -- Module: -- - } - - public interface G1 { - // -- Module: -- - } - - public interface G2 { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/simpleWithInheritance.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/simpleWithInheritance.txt index b18a66fd03c..93e65e6ff65 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/simpleWithInheritance.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/simpleWithInheritance.txt @@ -17,10 +17,6 @@ package package p { - public interface B { - // -- Module: -- - } - 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: -- - } - - public interface C : p.B { - // -- Module: -- - } - - public interface D : p.B { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/sinceKotlin.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/sinceKotlin.txt index 702076ed83b..d86beb992c8 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/sinceKotlin.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/sinceKotlin.txt @@ -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 } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/substitutedGenericInParams.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/substitutedGenericInParams.txt index 45163c06604..3dd0e6534b6 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/substitutedGenericInParams.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/substitutedGenericInParams.txt @@ -17,10 +17,6 @@ package package p { - public interface B { - // -- Module: -- - } - 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.String): kotlin.Unit @@ -50,12 +46,4 @@ package public fun test(/*0*/ b: p.B?): kotlin.Unit package p { - - public interface B { - // -- Module: -- - } - - public interface C : p.B { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/differentSuperTraits.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/differentSuperTraits.txt index f1c707bc1ca..ac37dc9f598 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/differentSuperTraits.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/differentSuperTraits.txt @@ -59,24 +59,4 @@ public final class Foo : p.C, p.B { } package p { - - public interface A : p.Base { - // -- Module: -- - } - - public interface B : p.Base { - // -- Module: -- - } - - public interface Base { - // -- Module: -- - } - - public interface Base { - // -- Module: -- - } - - public interface C : p.A { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTrait.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTrait.txt index daaf5a6bb10..c0af3b8aae0 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTrait.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTrait.txt @@ -52,20 +52,4 @@ public final class Foo : p.A, p.B { } package p { - - public interface A : p.Base { - // -- Module: -- - } - - public interface B : p.Base { - // -- Module: -- - } - - public interface Base { - // -- Module: -- - } - - public interface Base { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTraitDifferentBounds.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTraitDifferentBounds.txt index 36bbd119ddc..48124910f81 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTraitDifferentBounds.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTraitDifferentBounds.txt @@ -53,20 +53,4 @@ public final class Foo : p.A, p.B { } package p { - - public interface A : p.Base { - // -- Module: -- - } - - public interface B : p.Base { - // -- Module: -- - } - - public interface Base { - // -- Module: -- - } - - public interface Base { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTraitGenerics.txt b/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTraitGenerics.txt index 6e347e808f5..7edb22ef57d 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTraitGenerics.txt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTraitGenerics.txt @@ -52,20 +52,4 @@ public final class Foo : p.A, p.B { } package p { - - public interface A : p.Base { - // -- Module: -- - } - - public interface B : p.Base { - // -- Module: -- - } - - public interface Base { - // -- Module: -- - } - - public interface Base { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/hiddenClass/deprecatedHiddenImportPriority.txt b/compiler/testData/diagnostics/tests/multimodule/hiddenClass/deprecatedHiddenImportPriority.txt index cab91b0680f..e0bffdff9e9 100644 --- a/compiler/testData/diagnostics/tests/multimodule/hiddenClass/deprecatedHiddenImportPriority.txt +++ b/compiler/testData/diagnostics/tests/multimodule/hiddenClass/deprecatedHiddenImportPriority.txt @@ -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: -- - } } package p2 { - - public final class A { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/hiddenClass/deprecatedHiddenMultipleClasses.txt b/compiler/testData/diagnostics/tests/multimodule/hiddenClass/deprecatedHiddenMultipleClasses.txt index c95f2aa8474..4d728e18e8d 100644 --- a/compiler/testData/diagnostics/tests/multimodule/hiddenClass/deprecatedHiddenMultipleClasses.txt +++ b/compiler/testData/diagnostics/tests/multimodule/hiddenClass/deprecatedHiddenMultipleClasses.txt @@ -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: -- - } } package p2 { - - @kotlin.Deprecated(level = DeprecationLevel.HIDDEN, message = "2") public final class A { - // -- Module: -- - } } package p3 { - - @kotlin.Deprecated(level = DeprecationLevel.HIDDEN, message = "3") public final class A { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/hiddenClass/sinceKotlinImportPriority.txt b/compiler/testData/diagnostics/tests/multimodule/hiddenClass/sinceKotlinImportPriority.txt index eaf4e477f92..0921f12c68f 100644 --- a/compiler/testData/diagnostics/tests/multimodule/hiddenClass/sinceKotlinImportPriority.txt +++ b/compiler/testData/diagnostics/tests/multimodule/hiddenClass/sinceKotlinImportPriority.txt @@ -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: -- - } } package p2 { - - public final class A { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/hiddenClass/sinceKotlinMultipleClasses.txt b/compiler/testData/diagnostics/tests/multimodule/hiddenClass/sinceKotlinMultipleClasses.txt index b6e4eba395a..1e08969bd89 100644 --- a/compiler/testData/diagnostics/tests/multimodule/hiddenClass/sinceKotlinMultipleClasses.txt +++ b/compiler/testData/diagnostics/tests/multimodule/hiddenClass/sinceKotlinMultipleClasses.txt @@ -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: -- - } } package p2 { - - @kotlin.SinceKotlin(version = "1.1") public final class A { - // -- Module: -- - } } package p3 { - - @kotlin.SinceKotlin(version = "1.1") public final class A { - // -- Module: -- - } } diff --git a/compiler/testData/diagnostics/tests/multimodule/internal.txt b/compiler/testData/diagnostics/tests/multimodule/internal.txt index c2a33abbf99..ca3f1b37d60 100644 --- a/compiler/testData/diagnostics/tests/multimodule/internal.txt +++ b/compiler/testData/diagnostics/tests/multimodule/internal.txt @@ -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: -- - } - - internal final class B { - // -- Module: -- - } } - - diff --git a/compiler/testData/diagnostics/tests/multimodule/packagePrivate.txt b/compiler/testData/diagnostics/tests/multimodule/packagePrivate.txt index 8b8b38f4d74..25ec2a8304f 100644 --- a/compiler/testData/diagnostics/tests/multimodule/packagePrivate.txt +++ b/compiler/testData/diagnostics/tests/multimodule/packagePrivate.txt @@ -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 } diff --git a/compiler/testData/diagnostics/tests/multimodule/varargConflict.txt b/compiler/testData/diagnostics/tests/multimodule/varargConflict.txt index 8449c5e1bdc..16f27d03167 100644 --- a/compiler/testData/diagnostics/tests/multimodule/varargConflict.txt +++ b/compiler/testData/diagnostics/tests/multimodule/varargConflict.txt @@ -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 } diff --git a/compiler/testData/diagnostics/tests/qualifiedExpression/GenericClassVsPackage.txt b/compiler/testData/diagnostics/tests/qualifiedExpression/GenericClassVsPackage.txt index 32979ff96ca..dd031de2010 100644 --- a/compiler/testData/diagnostics/tests/qualifiedExpression/GenericClassVsPackage.txt +++ b/compiler/testData/diagnostics/tests/qualifiedExpression/GenericClassVsPackage.txt @@ -46,15 +46,7 @@ public fun test2(/*0*/ ab_c: a.b.c): kotlin.Unit package a { - public final class b { - // -- Module: -- - } - package a.b { - - public final class c { - // -- Module: -- - } } } @@ -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 { - // -- Module: -- -} - package a { - - public final class b { - // -- Module: -- - } } - - diff --git a/compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsClass.txt b/compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsClass.txt index 11ba6ed2f24..ebedca6d478 100644 --- a/compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsClass.txt +++ b/compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsClass.txt @@ -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: -- - } package a.b { - - public final class c { - // -- Module: -- - } } } diff --git a/compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsClass2.txt b/compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsClass2.txt index a083bf739bd..6c5415b7c2f 100644 --- a/compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsClass2.txt +++ b/compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsClass2.txt @@ -31,14 +31,6 @@ package a { package package a { - - public final class a { - // -- Module: -- - } - - public final class b { - // -- Module: -- - } } package test { @@ -57,18 +49,8 @@ package test { package package a { - - public final class a { - // -- Module: -- - } - - public final class b { - // -- Module: -- - } } package test { public fun foo(/*0*/ i: a.a): kotlin.Unit } - - diff --git a/compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsRootClass.txt b/compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsRootClass.txt index 332e241daa4..87b9a3cdda2 100644 --- a/compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsRootClass.txt +++ b/compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsRootClass.txt @@ -37,20 +37,10 @@ package public fun test(/*0*/ _ab: a.b): kotlin.Unit -public final class a { - // -- Module: -- -} - package a { public fun test(/*0*/ a_b: a.b): kotlin.Unit - - public final class b { - // -- Module: -- - } } package some { public fun test(/*0*/ a_b: a.b): kotlin.Unit } - - diff --git a/compiler/testData/diagnostics/tests/qualifiedExpression/visibleClassVsQualifiedClass.txt b/compiler/testData/diagnostics/tests/qualifiedExpression/visibleClassVsQualifiedClass.txt index 13ebd622262..8f654dd190b 100644 --- a/compiler/testData/diagnostics/tests/qualifiedExpression/visibleClassVsQualifiedClass.txt +++ b/compiler/testData/diagnostics/tests/qualifiedExpression/visibleClassVsQualifiedClass.txt @@ -39,10 +39,6 @@ package some { package package a { - - public final class b { - // -- Module: -- - } } 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: -- - } } diff --git a/compiler/testData/diagnostics/tests/smartCasts/publicVals/otherModule.txt b/compiler/testData/diagnostics/tests/smartCasts/publicVals/otherModule.txt index 30882c2c4b0..636370392ef 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/publicVals/otherModule.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/publicVals/otherModule.txt @@ -18,10 +18,6 @@ package package a { public fun a.X.gav(): kotlin.Int - - public final class X { - // -- Module: -- - } } package b { diff --git a/compiler/tests-common/org/jetbrains/kotlin/jvm/runtime/AbstractJvmRuntimeDescriptorLoaderTest.kt b/compiler/tests-common/org/jetbrains/kotlin/jvm/runtime/AbstractJvmRuntimeDescriptorLoaderTest.kt index 290a726d0b9..125c7fec2d6 100644 --- a/compiler/tests-common/org/jetbrains/kotlin/jvm/runtime/AbstractJvmRuntimeDescriptorLoaderTest.kt +++ b/compiler/tests-common/org/jetbrains/kotlin/jvm/runtime/AbstractJvmRuntimeDescriptorLoaderTest.kt @@ -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 = listOf( + object : PackageFragmentDescriptorImpl(module, fqName) { + override fun getMemberScope(): MemberScope = scope + } + ) + override fun accept(visitor: DeclarationDescriptorVisitor, 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) : MemberScopeImpl() { diff --git a/compiler/tests-common/org/jetbrains/kotlin/test/util/RecursiveDescriptorComparator.java b/compiler/tests-common/org/jetbrains/kotlin/test/util/RecursiveDescriptorComparator.java index c710596902e..396ca3bf336 100644 --- a/compiler/tests-common/org/jetbrains/kotlin/test/util/RecursiveDescriptorComparator.java +++ b/compiler/tests-common/org/jetbrains/kotlin/test/util/RecursiveDescriptorComparator.java @@ -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.emptyList(), printer); } @@ -176,6 +181,32 @@ public class RecursiveDescriptorComparator { } } + @NotNull + private MemberScope getPackageScopeInModule(@NotNull PackageViewDescriptor descriptor, @NotNull ModuleDescriptor module) { + // See LazyPackageViewDescriptorImpl#memberScope + List scopes = new ArrayList(); + 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 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 subDescriptors = Lists.newArrayList();