From 7541a3754d2c99e2c627e485a83daa759dca2de7 Mon Sep 17 00:00:00 2001 From: Mikhail Zarechenskiy Date: Thu, 4 May 2017 02:20:14 +0300 Subject: [PATCH] Move SAM constructors to synthetic scope --- .../synthetic/SamAdapterFunctionsScope.kt | 17 ++++++++++++++++- .../bound/expressionWithNullableType.txt | 1 - .../classLiteral/expressionWithNullableType.txt | 1 - .../tests/cyclicHierarchy/javaJavaCycle.txt | 6 ------ .../tests/cyclicHierarchy/javaJavaNested.txt | 6 ------ .../cyclicHierarchy/javaKotlinJavaCycle.txt | 3 --- .../cyclicHierarchy/kotlinJavaNestedCycle.txt | 3 --- .../tests/functionLiterals/kt11733_1.txt | 1 - .../multipleBoundsMemberScope/flexibleTypes.txt | 1 - .../testData/diagnostics/tests/inline/sam.txt | 1 - .../tests/j+k/computeIfAbsentConcurrent.txt | 2 -- .../tests/j+k/inheritAbstractSamAdapter.txt | 2 -- .../diagnostics/tests/j+k/overrideRawType.txt | 2 -- .../j+k/overrideWithSamAndTypeParameter.txt | 2 -- .../tests/j+k/recursiveRawUpperBound2.txt | 1 - .../tests/j+k/recursiveRawUpperBound3.txt | 1 - .../tests/j+k/sam/enhancedSamConstructor.txt | 2 -- .../tests/j+k/sam/samOnTypeParameter.txt | 3 --- .../j+k/sam/typeInferenceOnSamAdapters.txt | 1 - .../samByProjectedType/genericInReturnType.txt | 1 - .../genericInValueParameter.txt | 1 - .../samByProjectedType/genericSuperWildcard.txt | 1 - .../noAdapterBecuaseOfRecursiveUpperBound.txt | 1 - .../starProjectionComplexUpperBound.txt | 1 - .../tests/j+k/types/returnCollection.txt | 2 -- .../clashesOnInheritance/flexibleReturnType.txt | 2 -- .../flexibleReturnTypeIn.txt | 4 ---- .../flexibleReturnTypeList.txt | 2 -- .../genericWithUpperBound.txt | 3 --- .../clashesOnInheritance/kt13355viaJava.txt | 4 ---- .../override/parameterNames/jjkHierarchy.txt | 3 --- .../override/parameterNames/kjkHierarchy.txt | 2 -- .../parameterNames/kjkWithSeveralSupers.txt | 6 ------ .../kotlinInheritsBothJavaAndKotlin.txt | 2 -- .../parameterNames/kotlinInheritsJava.txt | 2 -- .../platformTypes/noAnnotationInClassPath.txt | 1 - .../enhancementFromAnnotation.txt | 1 - .../nullabilityWarnings/invoke.txt | 1 - .../tests/platformTypes/rawOverrides.txt | 2 -- .../tests/platformTypes/rawSamOverrides.txt | 4 ---- .../tests/platformTypes/rawTypes/samRaw.txt | 1 - .../saveAnnotationAfterSubstitution.txt | 5 ----- .../supertypeDifferentParameterNullability.txt | 3 --- .../supertypeDifferentReturnNullability.txt | 3 --- .../diagnostics/tests/regressions/kt16086.txt | 1 - .../intersectionScope/flexibleTypes.txt | 1 - .../smartCasts/variables/inPropertySam.txt | 2 -- .../apiVersion/overriddenMembers.txt | 1 - .../javaProperties/FromTwoBases.txt | 1 - .../javaProperties/KotlinOverridesJava2.txt | 2 -- .../javaProperties/KotlinOverridesJava3.txt | 2 -- .../javaProperties/KotlinOverridesJava4.txt | 2 -- .../javaProperties/KotlinOverridesJava5.txt | 1 - .../javaProperties/SmartCast.txt | 2 -- .../SmartCastImplicitReceiver.txt | 1 - .../javaProperties/TypeParameterReceiver.txt | 1 - .../samAdapters/InnerClassInGeneric.txt | 3 --- .../samAdapters/ParameterTypeAnnotation.txt | 1 - .../samAdapters/PassNull.txt | 1 - .../samAdapters/ReturnTypeAnnotation.txt | 1 - .../kt9820_javaFunctionTypeInheritor.txt | 1 - .../resolve/samOverloadsWithGenerics.txt | 3 --- ...mOverloadsWithGenericsWithoutRefinedSams.txt | 3 --- .../resolve/samOverloadsWithKtFunction.txt | 3 --- ...verloadsWithKtFunctionWithoutRefinedSams.txt | 3 --- .../typeAliasSamAdapterConstructors2.txt | 5 ----- .../loadJava/compiledJava/sam/Comparator.txt | 2 -- .../compiledJava/sam/FilenameFilter.txt | 2 -- .../GenericInterfaceParameterWithSelfBound.txt | 2 -- .../GenericInterfaceParametersWithBounds.txt | 2 -- .../loadJava/compiledJava/sam/Nested.txt | 6 ------ .../loadJava/compiledJava/sam/Runnable.txt | 2 -- .../compiledJava/sam/SamSubinterfaceOfTwo.txt | 5 ----- .../sam/SamSubinterfaceOverridding.txt | 2 -- .../sam/SubstitutedSamInterface.txt | 2 -- ...SubstitutedSamInterfaceSubclassOfBuiltin.txt | 2 -- .../compiledJava/sam/VarargParameter.txt | 2 -- .../compiledJava/sam/adapters/DeepSamLoop.txt | 4 ---- .../sam/adapters/PrivateSamAdapter.txt | 3 --- .../sam/adapters/SelfAsParameter.txt | 2 -- .../AdapterDoesntOverrideDeclaration.txt | 3 --- .../inheritance/InheritedSameAdapters.txt | 5 ----- .../InheritedSameAdaptersWithSubstitution.txt | 6 ------ .../adapters/inheritance/InheritedSimple.txt | 4 ---- .../compiledJavaAndKotlin/MixedPackage.txt | 1 - .../InheritParameterName.txt | 2 -- .../javaRefersToKotlin.txt | 2 -- .../loadJava/sourceJava/NullInAnnotation.txt | 2 -- .../lazy/descriptors/LazyJavaPackageScope.kt | 13 ++----------- .../descriptors/LazyJavaStaticClassScope.kt | 4 ---- .../testData/diagnostics/noParameters.txt | 1 - .../testData/diagnostics/noReturnType.txt | 1 - .../diagnostics/samConversionNoParameters.txt | 1 - .../diagnostics/samConversionSimple.txt | 1 - .../samConversionSimpleWithoutAnnotation.txt | 1 - .../testData/diagnostics/samWithAnnotation.txt | 1 - .../diagnostics/samWithoutAnnotation.txt | 1 - .../testData/diagnostics/singleParameter.txt | 1 - .../singleParameterWithoutAnnotation.txt | 1 - .../testData/script/samConversionSimple.txt | 2 -- 100 files changed, 18 insertions(+), 228 deletions(-) diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/SamAdapterFunctionsScope.kt b/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/SamAdapterFunctionsScope.kt index f164145e382..0da5551e73b 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/SamAdapterFunctionsScope.kt +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/SamAdapterFunctionsScope.kt @@ -25,6 +25,8 @@ import org.jetbrains.kotlin.descriptors.synthetic.SyntheticMemberDescriptor import org.jetbrains.kotlin.incremental.components.LookupLocation import org.jetbrains.kotlin.load.java.descriptors.JavaMethodDescriptor import org.jetbrains.kotlin.load.java.descriptors.SamAdapterDescriptor +import org.jetbrains.kotlin.load.java.descriptors.SamConstructorDescriptor +import org.jetbrains.kotlin.load.java.lazy.descriptors.LazyJavaClassDescriptor import org.jetbrains.kotlin.load.java.sam.SingleAbstractMethodUtils import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.resolve.calls.inference.wrapWithCapturingSubstitution @@ -56,6 +58,11 @@ class SamAdapterFunctionsScope( samAdapterForFunctionNotCached(function) } + private val samConstructorForClassifier = + storageManager.createMemoizedFunctionWithNullableValues { classifier -> + samConstructorForClassifierNotCached(classifier) + } + private fun extensionForFunctionNotCached(function: FunctionDescriptor): FunctionDescriptor? { if (!function.visibility.isVisibleOutside()) return null if (!function.hasJavaOriginInHierarchy()) return null //TODO: should we go into base at all? @@ -72,6 +79,13 @@ class SamAdapterFunctionsScope( return SingleAbstractMethodUtils.createSamAdapterFunction(function) } + private fun samConstructorForClassifierNotCached(classifier: ClassifierDescriptor): SamConstructorDescriptor? { + return if (classifier is LazyJavaClassDescriptor && classifier.functionTypeForSamInterface != null) { + SingleAbstractMethodUtils.createSamConstructorFunction(classifier.containingDeclaration, classifier) + } + else null + } + override fun getSyntheticMemberFunctions(receiverTypes: Collection, name: Name, location: LookupLocation): Collection { var result: SmartList? = null for (type in receiverTypes) { @@ -119,7 +133,8 @@ class SamAdapterFunctionsScope( override fun getSyntheticExtensionProperties(receiverTypes: Collection): Collection = emptyList() override fun getSyntheticStaticFunctions(scope: ResolutionScope, name: Name, location: LookupLocation): Collection { - return scope.getContributedFunctions(name, location).mapNotNull { samAdapterForStaticFunction(it) } + val samConstructor = scope.getContributedClassifier(name, location)?.let { samConstructorForClassifier(it) } + return scope.getContributedFunctions(name, location).mapNotNull { samAdapterForStaticFunction(it) } + listOfNotNull(samConstructor) } override fun getSyntheticStaticFunctions(scope: ResolutionScope): Collection { diff --git a/compiler/testData/diagnostics/tests/callableReference/bound/expressionWithNullableType.txt b/compiler/testData/diagnostics/tests/callableReference/bound/expressionWithNullableType.txt index 7798c8e4bcb..4aa69310a38 100644 --- a/compiler/testData/diagnostics/tests/callableReference/bound/expressionWithNullableType.txt +++ b/compiler/testData/diagnostics/tests/callableReference/bound/expressionWithNullableType.txt @@ -1,6 +1,5 @@ package -public /*synthesized*/ fun J(/*0*/ function: () -> kotlin.String!): J public fun f1(/*0*/ x: kotlin.Int?): kotlin.Any public fun f2(/*0*/ t: T): kotlin.Any public fun f3(/*0*/ s: S): kotlin.Any diff --git a/compiler/testData/diagnostics/tests/classLiteral/expressionWithNullableType.txt b/compiler/testData/diagnostics/tests/classLiteral/expressionWithNullableType.txt index 7798c8e4bcb..4aa69310a38 100644 --- a/compiler/testData/diagnostics/tests/classLiteral/expressionWithNullableType.txt +++ b/compiler/testData/diagnostics/tests/classLiteral/expressionWithNullableType.txt @@ -1,6 +1,5 @@ package -public /*synthesized*/ fun J(/*0*/ function: () -> kotlin.String!): J public fun f1(/*0*/ x: kotlin.Int?): kotlin.Any public fun f2(/*0*/ t: T): kotlin.Any public fun f3(/*0*/ s: S): kotlin.Any diff --git a/compiler/testData/diagnostics/tests/cyclicHierarchy/javaJavaCycle.txt b/compiler/testData/diagnostics/tests/cyclicHierarchy/javaJavaCycle.txt index 941a2828b49..e231978c152 100644 --- a/compiler/testData/diagnostics/tests/cyclicHierarchy/javaJavaCycle.txt +++ b/compiler/testData/diagnostics/tests/cyclicHierarchy/javaJavaCycle.txt @@ -1,6 +1,5 @@ package -public /*synthesized*/ fun A(/*0*/ function: () -> kotlin.Int): A public fun foo(): kotlin.Unit public interface A { @@ -24,9 +23,4 @@ public open class B { public/*package*/ interface B3 { public abstract fun getFoo(): kotlin.Int } - - // Static members - public/*package*/ final /*synthesized*/ fun B1(/*0*/ function: () -> kotlin.Int): B.B1 - public/*package*/ final /*synthesized*/ fun B2(/*0*/ function: () -> kotlin.Int): B.B2 - public/*package*/ final /*synthesized*/ fun B3(/*0*/ function: () -> kotlin.Int): B.B3 } diff --git a/compiler/testData/diagnostics/tests/cyclicHierarchy/javaJavaNested.txt b/compiler/testData/diagnostics/tests/cyclicHierarchy/javaJavaNested.txt index af0c054661f..42b2017f315 100644 --- a/compiler/testData/diagnostics/tests/cyclicHierarchy/javaJavaNested.txt +++ b/compiler/testData/diagnostics/tests/cyclicHierarchy/javaJavaNested.txt @@ -5,9 +5,6 @@ public interface A { public interface B { public abstract fun getFoo(): kotlin.Int } - - // Static members - public final /*synthesized*/ fun B(/*0*/ function: () -> kotlin.Int): A.B } public interface A0 { @@ -18,9 +15,6 @@ public interface A0 { public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } - - // Static members - public final /*synthesized*/ fun B(/*0*/ function: () -> kotlin.Int): A0.B } public open class B { diff --git a/compiler/testData/diagnostics/tests/cyclicHierarchy/javaKotlinJavaCycle.txt b/compiler/testData/diagnostics/tests/cyclicHierarchy/javaKotlinJavaCycle.txt index 58e05105ad5..3d4d8052a1f 100644 --- a/compiler/testData/diagnostics/tests/cyclicHierarchy/javaKotlinJavaCycle.txt +++ b/compiler/testData/diagnostics/tests/cyclicHierarchy/javaKotlinJavaCycle.txt @@ -1,8 +1,5 @@ package -public/*package*/ /*synthesized*/ fun A(/*0*/ function: () -> kotlin.Unit): A -public/*package*/ /*synthesized*/ fun C(/*0*/ function: () -> kotlin.Unit): C - public/*package*/ interface A { public abstract fun foo(): kotlin.Unit } diff --git a/compiler/testData/diagnostics/tests/cyclicHierarchy/kotlinJavaNestedCycle.txt b/compiler/testData/diagnostics/tests/cyclicHierarchy/kotlinJavaNestedCycle.txt index cb6886089d6..bbc33816e6f 100644 --- a/compiler/testData/diagnostics/tests/cyclicHierarchy/kotlinJavaNestedCycle.txt +++ b/compiler/testData/diagnostics/tests/cyclicHierarchy/kotlinJavaNestedCycle.txt @@ -13,9 +13,6 @@ public/*package*/ open class LockBasedStorageManager { public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } - - // Static members - public/*package*/ final /*synthesized*/ fun ExceptionHandlingStrategy(/*0*/ function: () -> kotlin.Unit): LockBasedStorageManager.ExceptionHandlingStrategy } public interface StorageManager { diff --git a/compiler/testData/diagnostics/tests/functionLiterals/kt11733_1.txt b/compiler/testData/diagnostics/tests/functionLiterals/kt11733_1.txt index c7d443d1d2d..3cf68d4a0f0 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/kt11733_1.txt +++ b/compiler/testData/diagnostics/tests/functionLiterals/kt11733_1.txt @@ -1,6 +1,5 @@ package -public /*synthesized*/ fun Predicate(/*0*/ function: (t: T) -> kotlin.Boolean): Predicate public fun main(/*0*/ args: kotlin.Array): kotlin.Unit public fun process(/*0*/ x: Predicate): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/generics/multipleBoundsMemberScope/flexibleTypes.txt b/compiler/testData/diagnostics/tests/generics/multipleBoundsMemberScope/flexibleTypes.txt index a46b0c08834..a61856d1d34 100644 --- a/compiler/testData/diagnostics/tests/generics/multipleBoundsMemberScope/flexibleTypes.txt +++ b/compiler/testData/diagnostics/tests/generics/multipleBoundsMemberScope/flexibleTypes.txt @@ -1,6 +1,5 @@ package -public /*synthesized*/ fun A(/*0*/ function: () -> kotlin.String!): A public fun test(/*0*/ x: T): kotlin.Unit where T : A, T : C public interface A { diff --git a/compiler/testData/diagnostics/tests/inline/sam.txt b/compiler/testData/diagnostics/tests/inline/sam.txt index 2fc5a59187a..fc04f4186f2 100644 --- a/compiler/testData/diagnostics/tests/inline/sam.txt +++ b/compiler/testData/diagnostics/tests/inline/sam.txt @@ -1,6 +1,5 @@ package -public /*synthesized*/ fun Run(/*0*/ function: () -> kotlin.Int): Run public inline fun inlineFunWithInvoke(/*0*/ s: (p: kotlin.Int) -> kotlin.Unit, /*1*/ ext: kotlin.Int.(p: kotlin.Int) -> kotlin.Unit): kotlin.Unit public inline fun inlineFunWithInvokeNonInline(/*0*/ noinline s: (p: kotlin.Int) -> kotlin.Unit, /*1*/ ext: kotlin.Int.(p: kotlin.Int) -> kotlin.Unit): kotlin.Unit public inline fun ((kotlin.Int) -> kotlin.Unit).inlineExt(): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/j+k/computeIfAbsentConcurrent.txt b/compiler/testData/diagnostics/tests/j+k/computeIfAbsentConcurrent.txt index 22c68c59490..90464bdc74c 100644 --- a/compiler/testData/diagnostics/tests/j+k/computeIfAbsentConcurrent.txt +++ b/compiler/testData/diagnostics/tests/j+k/computeIfAbsentConcurrent.txt @@ -1,7 +1,5 @@ package -public /*synthesized*/ fun ConcMap(/*0*/ function: (key: K!, mappingFunction: MyFunc!) -> V!): ConcMap -public /*synthesized*/ fun MyFunc(/*0*/ function: (String: K!) -> V!): MyFunc public fun concurrentMap(): kotlin.Unit public open class ConcHashMap : ConcMap { diff --git a/compiler/testData/diagnostics/tests/j+k/inheritAbstractSamAdapter.txt b/compiler/testData/diagnostics/tests/j+k/inheritAbstractSamAdapter.txt index 9b3e9d32357..b184f771d31 100644 --- a/compiler/testData/diagnostics/tests/j+k/inheritAbstractSamAdapter.txt +++ b/compiler/testData/diagnostics/tests/j+k/inheritAbstractSamAdapter.txt @@ -1,7 +1,5 @@ package -public /*synthesized*/ fun A(/*0*/ function: (r: java.lang.Runnable!) -> kotlin.Unit): A - public interface A { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public abstract fun foo(/*0*/ r: java.lang.Runnable!): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/j+k/overrideRawType.txt b/compiler/testData/diagnostics/tests/j+k/overrideRawType.txt index ca158fb7cbc..586a35e7d6d 100644 --- a/compiler/testData/diagnostics/tests/j+k/overrideRawType.txt +++ b/compiler/testData/diagnostics/tests/j+k/overrideRawType.txt @@ -1,7 +1,5 @@ package -public /*synthesized*/ fun Bar(/*0*/ function: (f: Foo<(raw) kotlin.CharSequence!>!) -> kotlin.Unit): Bar - public interface Bar { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public abstract fun f(/*0*/ f: Foo<(raw) kotlin.CharSequence!>!): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/j+k/overrideWithSamAndTypeParameter.txt b/compiler/testData/diagnostics/tests/j+k/overrideWithSamAndTypeParameter.txt index 0f706ef2d68..03d36f3a506 100644 --- a/compiler/testData/diagnostics/tests/j+k/overrideWithSamAndTypeParameter.txt +++ b/compiler/testData/diagnostics/tests/j+k/overrideWithSamAndTypeParameter.txt @@ -1,7 +1,5 @@ package -public /*synthesized*/ fun A(/*0*/ function: (key: K!, f: MyFunc!) -> K!): A -public /*synthesized*/ fun MyFunc(/*0*/ function: (x: kotlin.String!) -> kotlin.String!): MyFunc public fun main(): kotlin.Unit public interface A { diff --git a/compiler/testData/diagnostics/tests/j+k/recursiveRawUpperBound2.txt b/compiler/testData/diagnostics/tests/j+k/recursiveRawUpperBound2.txt index 647d7af530d..90f0caed94c 100644 --- a/compiler/testData/diagnostics/tests/j+k/recursiveRawUpperBound2.txt +++ b/compiler/testData/diagnostics/tests/j+k/recursiveRawUpperBound2.txt @@ -1,6 +1,5 @@ package -public /*synthesized*/ fun XYZ(/*0*/ function: () -> XYZ<(raw) [ERROR : Cyclic upper bounds]>!): XYZ public fun main(/*0*/ xyz: XYZ<*>): XYZ<(raw) [ERROR : Cyclic upper bounds]>! public interface XYZ { diff --git a/compiler/testData/diagnostics/tests/j+k/recursiveRawUpperBound3.txt b/compiler/testData/diagnostics/tests/j+k/recursiveRawUpperBound3.txt index c9c34daf7f7..d55cd2baae0 100644 --- a/compiler/testData/diagnostics/tests/j+k/recursiveRawUpperBound3.txt +++ b/compiler/testData/diagnostics/tests/j+k/recursiveRawUpperBound3.txt @@ -1,6 +1,5 @@ package -public /*synthesized*/ fun XYZ(/*0*/ function: () -> XYZ<(raw) [ERROR : Cyclic upper bounds], (raw) [ERROR : Cyclic upper bounds], (raw) [ERROR : Cyclic upper bounds]>!): XYZ public fun main(/*0*/ xyz: XYZ<*, *, *>): XYZ<(raw) [ERROR : Cyclic upper bounds], (raw) [ERROR : Cyclic upper bounds], (raw) [ERROR : Cyclic upper bounds]>! public interface XYZ { diff --git a/compiler/testData/diagnostics/tests/j+k/sam/enhancedSamConstructor.txt b/compiler/testData/diagnostics/tests/j+k/sam/enhancedSamConstructor.txt index 070a6e409be..b2b650cf0de 100644 --- a/compiler/testData/diagnostics/tests/j+k/sam/enhancedSamConstructor.txt +++ b/compiler/testData/diagnostics/tests/j+k/sam/enhancedSamConstructor.txt @@ -1,7 +1,5 @@ package -public /*synthesized*/ fun J(/*0*/ function: (x: kotlin.String?) -> kotlin.String): J -public /*synthesized*/ fun J2(/*0*/ function: (x: kotlin.String?) -> kotlin.String): J2 public fun main(): kotlin.Unit public interface J { diff --git a/compiler/testData/diagnostics/tests/j+k/sam/samOnTypeParameter.txt b/compiler/testData/diagnostics/tests/j+k/sam/samOnTypeParameter.txt index 03e070dfeec..4a0247a8901 100644 --- a/compiler/testData/diagnostics/tests/j+k/sam/samOnTypeParameter.txt +++ b/compiler/testData/diagnostics/tests/j+k/sam/samOnTypeParameter.txt @@ -15,7 +15,4 @@ public open class FormFieldValidatorPresenterTest { public abstract fun onValidityChanged(/*0*/ valid: kotlin.Boolean): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } - - // Static members - public final /*synthesized*/ fun ValidationListenerTest(/*0*/ function: (valid: kotlin.Boolean) -> kotlin.Unit): FormFieldValidatorPresenterTest.ValidationListenerTest } diff --git a/compiler/testData/diagnostics/tests/j+k/sam/typeInferenceOnSamAdapters.txt b/compiler/testData/diagnostics/tests/j+k/sam/typeInferenceOnSamAdapters.txt index d07ec525394..7cd61c7f1c4 100644 --- a/compiler/testData/diagnostics/tests/j+k/sam/typeInferenceOnSamAdapters.txt +++ b/compiler/testData/diagnostics/tests/j+k/sam/typeInferenceOnSamAdapters.txt @@ -1,6 +1,5 @@ package -public /*synthesized*/ fun BiFunction(/*0*/ function: (t: T!, u: U!) -> R!): BiFunction public fun main(): kotlin.Unit public open class A { diff --git a/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericInReturnType.txt b/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericInReturnType.txt index 85696f75288..4adaf10cd2c 100644 --- a/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericInReturnType.txt +++ b/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericInReturnType.txt @@ -1,6 +1,5 @@ package -public /*synthesized*/ fun EventListener(/*0*/ function: (x: kotlin.String!) -> E!): EventListener public fun main(): kotlin.Unit public open class A { diff --git a/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericInValueParameter.txt b/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericInValueParameter.txt index 91ba446dde1..e96752524c2 100644 --- a/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericInValueParameter.txt +++ b/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericInValueParameter.txt @@ -1,6 +1,5 @@ package -public /*synthesized*/ fun EventListener(/*0*/ function: (e: E!) -> kotlin.Unit): EventListener public fun main(): kotlin.Unit public open class A { diff --git a/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericSuperWildcard.txt b/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericSuperWildcard.txt index 90fdd75a881..c90ad31d19e 100644 --- a/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericSuperWildcard.txt +++ b/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericSuperWildcard.txt @@ -1,6 +1,5 @@ package -public /*synthesized*/ fun EventListener(/*0*/ function: (e: E!) -> kotlin.Unit): EventListener public fun main(): kotlin.Unit public open class A { diff --git a/compiler/testData/diagnostics/tests/j+k/samByProjectedType/noAdapterBecuaseOfRecursiveUpperBound.txt b/compiler/testData/diagnostics/tests/j+k/samByProjectedType/noAdapterBecuaseOfRecursiveUpperBound.txt index b62786caa6f..7eb91f3b412 100644 --- a/compiler/testData/diagnostics/tests/j+k/samByProjectedType/noAdapterBecuaseOfRecursiveUpperBound.txt +++ b/compiler/testData/diagnostics/tests/j+k/samByProjectedType/noAdapterBecuaseOfRecursiveUpperBound.txt @@ -1,6 +1,5 @@ package -public /*synthesized*/ fun !> Function(/*0*/ function: (f: F!) -> E!): Function public fun main(): kotlin.Unit public open class A { diff --git a/compiler/testData/diagnostics/tests/j+k/samByProjectedType/starProjectionComplexUpperBound.txt b/compiler/testData/diagnostics/tests/j+k/samByProjectedType/starProjectionComplexUpperBound.txt index 5b720def9ea..ae42d8198fb 100644 --- a/compiler/testData/diagnostics/tests/j+k/samByProjectedType/starProjectionComplexUpperBound.txt +++ b/compiler/testData/diagnostics/tests/j+k/samByProjectedType/starProjectionComplexUpperBound.txt @@ -1,6 +1,5 @@ package -public /*synthesized*/ fun !, /*1*/ F : kotlin.CharSequence!> Function(/*0*/ function: (e: E!) -> F!): Function public fun main(): kotlin.Unit public open class A { diff --git a/compiler/testData/diagnostics/tests/j+k/types/returnCollection.txt b/compiler/testData/diagnostics/tests/j+k/types/returnCollection.txt index 08467aacde0..d10e13149cc 100644 --- a/compiler/testData/diagnostics/tests/j+k/types/returnCollection.txt +++ b/compiler/testData/diagnostics/tests/j+k/types/returnCollection.txt @@ -1,7 +1,5 @@ package -public/*package*/ /*synthesized*/ fun J(/*0*/ function: () -> kotlin.collections.List): J - public/*package*/ interface J : K { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public abstract override /*1*/ fun foo(): kotlin.collections.List diff --git a/compiler/testData/diagnostics/tests/override/clashesOnInheritance/flexibleReturnType.txt b/compiler/testData/diagnostics/tests/override/clashesOnInheritance/flexibleReturnType.txt index 8d699928b6e..d64327122a6 100644 --- a/compiler/testData/diagnostics/tests/override/clashesOnInheritance/flexibleReturnType.txt +++ b/compiler/testData/diagnostics/tests/override/clashesOnInheritance/flexibleReturnType.txt @@ -1,7 +1,5 @@ package -public /*synthesized*/ fun J(/*0*/ function: () -> kotlin.String!): J - public interface J { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public abstract fun foo(): kotlin.String! diff --git a/compiler/testData/diagnostics/tests/override/clashesOnInheritance/flexibleReturnTypeIn.txt b/compiler/testData/diagnostics/tests/override/clashesOnInheritance/flexibleReturnTypeIn.txt index 667c5fdada5..39945c44753 100644 --- a/compiler/testData/diagnostics/tests/override/clashesOnInheritance/flexibleReturnTypeIn.txt +++ b/compiler/testData/diagnostics/tests/override/clashesOnInheritance/flexibleReturnTypeIn.txt @@ -1,9 +1,5 @@ package -public /*synthesized*/ fun J1(/*0*/ function: () -> In!): J1 -public /*synthesized*/ fun J2(/*0*/ function: () -> In): J2 -public /*synthesized*/ fun J3(/*0*/ function: () -> In?): J3 - public interface In { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/override/clashesOnInheritance/flexibleReturnTypeList.txt b/compiler/testData/diagnostics/tests/override/clashesOnInheritance/flexibleReturnTypeList.txt index 095052e0566..4139504c4c3 100644 --- a/compiler/testData/diagnostics/tests/override/clashesOnInheritance/flexibleReturnTypeList.txt +++ b/compiler/testData/diagnostics/tests/override/clashesOnInheritance/flexibleReturnTypeList.txt @@ -1,7 +1,5 @@ package -public /*synthesized*/ fun J(/*0*/ function: () -> kotlin.collections.(Mutable)List!): J - public interface ILNS { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public abstract fun foo(): kotlin.collections.List diff --git a/compiler/testData/diagnostics/tests/override/clashesOnInheritance/genericWithUpperBound.txt b/compiler/testData/diagnostics/tests/override/clashesOnInheritance/genericWithUpperBound.txt index ccde6e233ac..13e97ec80ae 100644 --- a/compiler/testData/diagnostics/tests/override/clashesOnInheritance/genericWithUpperBound.txt +++ b/compiler/testData/diagnostics/tests/override/clashesOnInheritance/genericWithUpperBound.txt @@ -1,8 +1,5 @@ package -public /*synthesized*/ fun JFooWithUpperBound(/*0*/ function: () -> T!): JFooWithUpperBound -public /*synthesized*/ fun JFooWithUpperBoundDerived(/*0*/ function: () -> T!): JFooWithUpperBoundDerived - public interface IBase { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/override/clashesOnInheritance/kt13355viaJava.txt b/compiler/testData/diagnostics/tests/override/clashesOnInheritance/kt13355viaJava.txt index 7119cdc9242..f4e77629f0b 100644 --- a/compiler/testData/diagnostics/tests/override/clashesOnInheritance/kt13355viaJava.txt +++ b/compiler/testData/diagnostics/tests/override/clashesOnInheritance/kt13355viaJava.txt @@ -99,8 +99,4 @@ public open class TestNN { public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String } - - // Static members - public final /*synthesized*/ fun JNotNull(/*0*/ function: () -> kotlin.Any): TestNN.JNotNull - public final /*synthesized*/ fun JNull(/*0*/ function: () -> kotlin.Any?): TestNN.JNull } diff --git a/compiler/testData/diagnostics/tests/override/parameterNames/jjkHierarchy.txt b/compiler/testData/diagnostics/tests/override/parameterNames/jjkHierarchy.txt index 81a3f49faa4..f3b4d0995fe 100644 --- a/compiler/testData/diagnostics/tests/override/parameterNames/jjkHierarchy.txt +++ b/compiler/testData/diagnostics/tests/override/parameterNames/jjkHierarchy.txt @@ -1,8 +1,5 @@ package -public/*package*/ /*synthesized*/ fun Sub(/*0*/ function: (superName: kotlin.Long) -> kotlin.Unit): Sub -public/*package*/ /*synthesized*/ fun Super(/*0*/ function: (superName: kotlin.Long) -> kotlin.Unit): Super - public/*package*/ interface Sub : Super { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public abstract override /*1*/ /*fake_override*/ fun foo(/*0*/ superName: kotlin.Long): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/override/parameterNames/kjkHierarchy.txt b/compiler/testData/diagnostics/tests/override/parameterNames/kjkHierarchy.txt index c2b7cbbad61..07fec1cf8df 100644 --- a/compiler/testData/diagnostics/tests/override/parameterNames/kjkHierarchy.txt +++ b/compiler/testData/diagnostics/tests/override/parameterNames/kjkHierarchy.txt @@ -1,7 +1,5 @@ package -public/*package*/ /*synthesized*/ fun Sub(/*0*/ function: (superName: kotlin.Int) -> kotlin.Unit): Sub - public/*package*/ interface Sub : Super { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public abstract override /*1*/ /*fake_override*/ fun foo(/*0*/ superName: kotlin.Int): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/override/parameterNames/kjkWithSeveralSupers.txt b/compiler/testData/diagnostics/tests/override/parameterNames/kjkWithSeveralSupers.txt index fea5b822b67..d7f008d95c8 100644 --- a/compiler/testData/diagnostics/tests/override/parameterNames/kjkWithSeveralSupers.txt +++ b/compiler/testData/diagnostics/tests/override/parameterNames/kjkWithSeveralSupers.txt @@ -1,11 +1,5 @@ package -public/*package*/ /*synthesized*/ fun JSuper1(/*0*/ function: (jsuper1Name: kotlin.Int) -> kotlin.Unit): JSuper1 -public/*package*/ /*synthesized*/ fun JSuper2(/*0*/ function: (jsuper2Name: kotlin.Int) -> kotlin.Unit): JSuper2 -public/*package*/ /*synthesized*/ fun Sub1(/*0*/ function: (ksuperName: kotlin.Int) -> kotlin.Unit): Sub1 -public/*package*/ /*synthesized*/ fun Sub2(/*0*/ function: (ksuperName: kotlin.Int) -> kotlin.Unit): Sub2 -public/*package*/ /*synthesized*/ fun Sub3(/*0*/ function: (ksuperName: kotlin.Int) -> kotlin.Unit): Sub3 - public/*package*/ interface JSuper1 { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public abstract fun foo(/*0*/ jsuper1Name: kotlin.Int): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/override/parameterNames/kotlinInheritsBothJavaAndKotlin.txt b/compiler/testData/diagnostics/tests/override/parameterNames/kotlinInheritsBothJavaAndKotlin.txt index 967559200fa..aa5acb395cb 100644 --- a/compiler/testData/diagnostics/tests/override/parameterNames/kotlinInheritsBothJavaAndKotlin.txt +++ b/compiler/testData/diagnostics/tests/override/parameterNames/kotlinInheritsBothJavaAndKotlin.txt @@ -1,7 +1,5 @@ package -public/*package*/ /*synthesized*/ fun JavaInterface(/*0*/ function: (javaName: kotlin.Int) -> kotlin.Unit): JavaInterface - public final class BothTraitsSubclass : JavaInterface, KotlinTrait { public constructor BothTraitsSubclass() public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean diff --git a/compiler/testData/diagnostics/tests/override/parameterNames/kotlinInheritsJava.txt b/compiler/testData/diagnostics/tests/override/parameterNames/kotlinInheritsJava.txt index 5c091661dfa..9128d55d916 100644 --- a/compiler/testData/diagnostics/tests/override/parameterNames/kotlinInheritsJava.txt +++ b/compiler/testData/diagnostics/tests/override/parameterNames/kotlinInheritsJava.txt @@ -1,7 +1,5 @@ package -public /*synthesized*/ fun JavaInterface(/*0*/ function: (javaName: kotlin.Int) -> kotlin.Unit): JavaInterface - public interface JavaInterface { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public abstract fun foo(/*0*/ javaName: kotlin.Int): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/platformTypes/noAnnotationInClassPath.txt b/compiler/testData/diagnostics/tests/platformTypes/noAnnotationInClassPath.txt index 513618368dd..024d80d06d2 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/noAnnotationInClassPath.txt +++ b/compiler/testData/diagnostics/tests/platformTypes/noAnnotationInClassPath.txt @@ -1,6 +1,5 @@ package -public /*synthesized*/ fun A(/*0*/ function: (y: T?) -> kotlin.Boolean): A public fun test(): kotlin.Unit public interface A { diff --git a/compiler/testData/diagnostics/tests/platformTypes/notNullTypeParameter/enhancementFromAnnotation.txt b/compiler/testData/diagnostics/tests/platformTypes/notNullTypeParameter/enhancementFromAnnotation.txt index 20edb45650a..33c5fe77aeb 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/notNullTypeParameter/enhancementFromAnnotation.txt +++ b/compiler/testData/diagnostics/tests/platformTypes/notNullTypeParameter/enhancementFromAnnotation.txt @@ -1,6 +1,5 @@ package -public /*synthesized*/ fun A(/*0*/ function: (x: T) -> kotlin.Unit): A public fun test(): kotlin.Unit public interface A { diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/invoke.txt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/invoke.txt index 44bf3c0d210..cdf70664e7a 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/invoke.txt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/invoke.txt @@ -19,5 +19,4 @@ public open class J { public final var staticJ: J.Invoke! @org.jetbrains.annotations.Nullable public final var staticN: J.Invoke? @org.jetbrains.annotations.NotNull public final var staticNN: J.Invoke - public final /*synthesized*/ fun Invoke(/*0*/ function: () -> kotlin.Unit): J.Invoke } diff --git a/compiler/testData/diagnostics/tests/platformTypes/rawOverrides.txt b/compiler/testData/diagnostics/tests/platformTypes/rawOverrides.txt index 90ebfea7a0f..8f91d9f72f3 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/rawOverrides.txt +++ b/compiler/testData/diagnostics/tests/platformTypes/rawOverrides.txt @@ -1,7 +1,5 @@ package -public /*synthesized*/ fun B(/*0*/ function: (x: kotlin.Any!, y: kotlin.collections.(Mutable)List<(raw) kotlin.Any?>!) -> kotlin.String!): B - public interface A { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public abstract fun foo(/*0*/ x: T!, /*1*/ y: (kotlin.collections.MutableList..kotlin.collections.List?)): E! diff --git a/compiler/testData/diagnostics/tests/platformTypes/rawSamOverrides.txt b/compiler/testData/diagnostics/tests/platformTypes/rawSamOverrides.txt index bd074c30e65..60057bc2175 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/rawSamOverrides.txt +++ b/compiler/testData/diagnostics/tests/platformTypes/rawSamOverrides.txt @@ -1,9 +1,5 @@ package -public /*synthesized*/ fun A(/*0*/ function: (x: T!, y: Fun!) -> kotlin.Unit): A -public /*synthesized*/ fun B(/*0*/ function: (x: kotlin.Any!, y: Fun<(raw) kotlin.Any!>!) -> kotlin.Unit): B -public /*synthesized*/ fun Fun(/*0*/ function: (x: T!) -> kotlin.Unit): Fun - public interface A { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public abstract fun foo(/*0*/ x: T!, /*1*/ y: Fun!): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/samRaw.txt b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/samRaw.txt index bc93a7ab0fa..c0b1423899b 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/samRaw.txt +++ b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/samRaw.txt @@ -1,6 +1,5 @@ package -public /*synthesized*/ fun A(/*0*/ function: (t: T!) -> kotlin.Boolean): A public fun main(): kotlin.Unit public interface A { diff --git a/compiler/testData/diagnostics/tests/platformTypes/typeEnhancement/saveAnnotationAfterSubstitution.txt b/compiler/testData/diagnostics/tests/platformTypes/typeEnhancement/saveAnnotationAfterSubstitution.txt index 6bd79c85f16..03b45a1e3a3 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/typeEnhancement/saveAnnotationAfterSubstitution.txt +++ b/compiler/testData/diagnostics/tests/platformTypes/typeEnhancement/saveAnnotationAfterSubstitution.txt @@ -1,10 +1,5 @@ package -public /*synthesized*/ fun A(/*0*/ function: (x: T, y: T?) -> kotlin.Unit): A -public /*synthesized*/ fun B1(/*0*/ function: (x: kotlin.String, y: kotlin.String?) -> kotlin.Unit): B1 -public /*synthesized*/ fun B2(/*0*/ function: (x: kotlin.String, y: kotlin.String?) -> kotlin.Unit): B2 -public /*synthesized*/ fun B3(/*0*/ function: (x: kotlin.String!, y: kotlin.String!) -> kotlin.Unit): B3 - public interface A { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public abstract fun foo(/*0*/ @org.jetbrains.annotations.NotNull x: T, /*1*/ @org.jetbrains.annotations.Nullable y: T?): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/platformTypes/typeEnhancement/supertypeDifferentParameterNullability.txt b/compiler/testData/diagnostics/tests/platformTypes/typeEnhancement/supertypeDifferentParameterNullability.txt index a4d2ccb0a69..649b7c7f88b 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/typeEnhancement/supertypeDifferentParameterNullability.txt +++ b/compiler/testData/diagnostics/tests/platformTypes/typeEnhancement/supertypeDifferentParameterNullability.txt @@ -1,8 +1,5 @@ package -public /*synthesized*/ fun A(/*0*/ function: (x: kotlin.String?) -> kotlin.Unit): A -public /*synthesized*/ fun B(/*0*/ function: (x: kotlin.String) -> kotlin.Unit): B - public interface A { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public abstract fun foo(/*0*/ @org.jetbrains.annotations.Nullable x: kotlin.String?): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/platformTypes/typeEnhancement/supertypeDifferentReturnNullability.txt b/compiler/testData/diagnostics/tests/platformTypes/typeEnhancement/supertypeDifferentReturnNullability.txt index 9d949d620f1..3c036bd0ee6 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/typeEnhancement/supertypeDifferentReturnNullability.txt +++ b/compiler/testData/diagnostics/tests/platformTypes/typeEnhancement/supertypeDifferentReturnNullability.txt @@ -1,8 +1,5 @@ package -public /*synthesized*/ fun A(/*0*/ function: () -> kotlin.String?): A -public /*synthesized*/ fun B(/*0*/ function: () -> kotlin.String): B - public interface A { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean @org.jetbrains.annotations.Nullable public abstract fun foo(): kotlin.String? diff --git a/compiler/testData/diagnostics/tests/regressions/kt16086.txt b/compiler/testData/diagnostics/tests/regressions/kt16086.txt index ced19ac5b32..61938e9be3e 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt16086.txt +++ b/compiler/testData/diagnostics/tests/regressions/kt16086.txt @@ -5,7 +5,6 @@ package com { package com.winterbe { package com.winterbe.domain { - public /*synthesized*/ fun IEntity(/*0*/ function: () -> com.winterbe.observer.ObserverSupport<(raw) com.winterbe.domain.IEntity>!): com.winterbe.domain.IEntity public interface IEntity { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean diff --git a/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/flexibleTypes.txt b/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/flexibleTypes.txt index 923e3f71c36..167c522038a 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/flexibleTypes.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/flexibleTypes.txt @@ -1,6 +1,5 @@ package -public /*synthesized*/ fun A(/*0*/ function: () -> kotlin.String!): A public fun foo(/*0*/ x: kotlin.Any?): kotlin.Unit public interface A { diff --git a/compiler/testData/diagnostics/tests/smartCasts/variables/inPropertySam.txt b/compiler/testData/diagnostics/tests/smartCasts/variables/inPropertySam.txt index d15db914bef..3ba8dd263b1 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/variables/inPropertySam.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/variables/inPropertySam.txt @@ -1,7 +1,5 @@ package -public /*synthesized*/ fun My(/*0*/ function: (arg: kotlin.String!) -> kotlin.String!): My - public interface My { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public abstract fun foo(/*0*/ arg: kotlin.String!): kotlin.String! diff --git a/compiler/testData/diagnostics/tests/sourceCompatibility/apiVersion/overriddenMembers.txt b/compiler/testData/diagnostics/tests/sourceCompatibility/apiVersion/overriddenMembers.txt index 461f76d6e5c..a102829c3de 100644 --- a/compiler/testData/diagnostics/tests/sourceCompatibility/apiVersion/overriddenMembers.txt +++ b/compiler/testData/diagnostics/tests/sourceCompatibility/apiVersion/overriddenMembers.txt @@ -1,6 +1,5 @@ package -public /*synthesized*/ fun J(/*0*/ function: () -> kotlin.Unit): J public fun f1(/*0*/ x: I10): kotlin.Unit public fun f2(/*0*/ x: I11): [ERROR : Error function type] public fun f3(/*0*/ x: J): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/FromTwoBases.txt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/FromTwoBases.txt index de0983739c3..2cdd80e79f3 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/FromTwoBases.txt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/FromTwoBases.txt @@ -1,6 +1,5 @@ package -public /*synthesized*/ fun A(/*0*/ function: () -> kotlin.Int): A public fun foo(/*0*/ c: C): kotlin.Unit public interface A { diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava2.txt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava2.txt index b33050604c4..18135becf1a 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava2.txt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava2.txt @@ -1,7 +1,5 @@ package -public /*synthesized*/ fun JavaInterface1(/*0*/ function: () -> kotlin.String!): JavaInterface1 -public /*synthesized*/ fun JavaInterface2(/*0*/ function: (value: kotlin.Int) -> kotlin.Unit): JavaInterface2 public fun foo(/*0*/ k: KotlinClass): kotlin.Unit public fun useString(/*0*/ i: kotlin.String): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava3.txt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava3.txt index d220142d8fe..478d3136880 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava3.txt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava3.txt @@ -1,7 +1,5 @@ package -public /*synthesized*/ fun JavaInterface1(/*0*/ function: () -> kotlin.String!): JavaInterface1 -public /*synthesized*/ fun JavaInterface2(/*0*/ function: (value: kotlin.String!) -> kotlin.Unit): JavaInterface2 public fun foo(/*0*/ k: KotlinClass): kotlin.Unit public fun useString(/*0*/ i: kotlin.String): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava4.txt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava4.txt index ad0d862eb71..e0cd66edc68 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava4.txt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava4.txt @@ -1,7 +1,5 @@ package -public /*synthesized*/ fun JavaInterface1(/*0*/ function: () -> kotlin.String!): JavaInterface1 -public /*synthesized*/ fun JavaInterface2(/*0*/ function: (value: kotlin.String!) -> kotlin.Unit): JavaInterface2 public fun foo(/*0*/ k: KotlinClass): kotlin.Unit public fun useString(/*0*/ i: kotlin.String): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava5.txt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava5.txt index 1217bf3f804..7c83492b251 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava5.txt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava5.txt @@ -1,6 +1,5 @@ package -public /*synthesized*/ fun JavaInterface1(/*0*/ function: () -> kotlin.String!): JavaInterface1 public fun foo(/*0*/ k: KotlinClass): kotlin.Unit public fun useString(/*0*/ i: kotlin.String): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/SmartCast.txt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/SmartCast.txt index 4316c603b2b..9348d5a1591 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/SmartCast.txt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/SmartCast.txt @@ -1,7 +1,5 @@ package -public /*synthesized*/ fun JavaInterface(/*0*/ function: () -> kotlin.Int): JavaInterface -public /*synthesized*/ fun JavaInterface2(/*0*/ function: () -> kotlin.Int): JavaInterface2 public fun foo(/*0*/ o: JavaInterface2): kotlin.Int public abstract class BaseClass : JavaInterface { diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/SmartCastImplicitReceiver.txt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/SmartCastImplicitReceiver.txt index d4acda57795..85bb459542a 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/SmartCastImplicitReceiver.txt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/SmartCastImplicitReceiver.txt @@ -1,6 +1,5 @@ package -public /*synthesized*/ fun JavaInterface(/*0*/ function: () -> kotlin.Int): JavaInterface public fun kotlin.Any.foo(): kotlin.Int public abstract class BaseClass : JavaInterface { diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/TypeParameterReceiver.txt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/TypeParameterReceiver.txt index 1d891510e49..48e6f91884f 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/TypeParameterReceiver.txt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/TypeParameterReceiver.txt @@ -1,6 +1,5 @@ package -public /*synthesized*/ fun A(/*0*/ function: () -> kotlin.Int): A public fun foo(/*0*/ t: T): kotlin.Unit public interface A { diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/InnerClassInGeneric.txt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/InnerClassInGeneric.txt index e963c4cec3b..3594e81a133 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/InnerClassInGeneric.txt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/InnerClassInGeneric.txt @@ -15,7 +15,4 @@ public open class JavaClass { public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } - - // Static members - public final /*synthesized*/ fun Inner(/*0*/ function: (t: T!, x: X!, runnable: java.lang.Runnable!) -> T!): JavaClass.Inner } diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/ParameterTypeAnnotation.txt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/ParameterTypeAnnotation.txt index e2b868b97bc..6da3c051ab8 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/ParameterTypeAnnotation.txt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/ParameterTypeAnnotation.txt @@ -1,6 +1,5 @@ package -public /*synthesized*/ fun JavaInterface(/*0*/ function: (s: kotlin.String, runnable: java.lang.Runnable) -> kotlin.Unit): JavaInterface public fun foo(/*0*/ javaInterface: JavaInterface): kotlin.Unit public interface JavaInterface { diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/PassNull.txt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/PassNull.txt index ff2b7a03df2..4624a0d5918 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/PassNull.txt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/PassNull.txt @@ -1,6 +1,5 @@ package -public /*synthesized*/ fun JavaInterface(/*0*/ function: (s: kotlin.String!, runnable1: java.lang.Runnable!, runnable2: java.lang.Runnable!) -> kotlin.Unit): JavaInterface public fun foo(/*0*/ javaInterface: JavaInterface): kotlin.Unit public interface JavaInterface { diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/ReturnTypeAnnotation.txt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/ReturnTypeAnnotation.txt index a79b8a83192..231bb1549dc 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/ReturnTypeAnnotation.txt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/ReturnTypeAnnotation.txt @@ -1,6 +1,5 @@ package -public /*synthesized*/ fun Provider(/*0*/ function: () -> T!): Provider public fun foo(/*0*/ javaInterface: JavaInterface): kotlin.Unit public interface JavaInterface { diff --git a/compiler/testData/diagnostics/testsWithStdLib/regression/kt9820_javaFunctionTypeInheritor.txt b/compiler/testData/diagnostics/testsWithStdLib/regression/kt9820_javaFunctionTypeInheritor.txt index e7782edda6a..a59a160cdb6 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/regression/kt9820_javaFunctionTypeInheritor.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/regression/kt9820_javaFunctionTypeInheritor.txt @@ -1,6 +1,5 @@ package -public /*synthesized*/ fun J(/*0*/ function: (kotlin.Int!) -> java.lang.Void!): J public fun jj(): kotlin.Unit public fun useJ(/*0*/ j: J): kotlin.Unit diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenerics.txt b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenerics.txt index b0dfa3e686a..dd7bce600c5 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenerics.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenerics.txt @@ -18,7 +18,4 @@ public/*package*/ open class Foo { public abstract operator fun invoke(/*0*/ i: T!): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } - - // Static members - public/*package*/ final /*synthesized*/ fun FObject(/*0*/ function: (i: T!) -> kotlin.Unit): Foo.FObject } diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenericsWithoutRefinedSams.txt b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenericsWithoutRefinedSams.txt index b0dfa3e686a..dd7bce600c5 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenericsWithoutRefinedSams.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenericsWithoutRefinedSams.txt @@ -18,7 +18,4 @@ public/*package*/ open class Foo { public abstract operator fun invoke(/*0*/ i: T!): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } - - // Static members - public/*package*/ final /*synthesized*/ fun FObject(/*0*/ function: (i: T!) -> kotlin.Unit): Foo.FObject } diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunction.txt b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunction.txt index 19495886a30..91c9531c13d 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunction.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunction.txt @@ -16,7 +16,4 @@ public open class Foo { public abstract operator fun invoke(/*0*/ i: kotlin.Any!): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } - - // Static members - public/*package*/ final /*synthesized*/ fun FObject(/*0*/ function: (i: kotlin.Any!) -> kotlin.Unit): Foo.FObject } diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunctionWithoutRefinedSams.txt b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunctionWithoutRefinedSams.txt index 19495886a30..91c9531c13d 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunctionWithoutRefinedSams.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunctionWithoutRefinedSams.txt @@ -16,7 +16,4 @@ public open class Foo { public abstract operator fun invoke(/*0*/ i: kotlin.Any!): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } - - // Static members - public/*package*/ final /*synthesized*/ fun FObject(/*0*/ function: (i: kotlin.Any!) -> kotlin.Unit): Foo.FObject } diff --git a/compiler/testData/diagnostics/testsWithStdLib/typealias/typeAliasSamAdapterConstructors2.txt b/compiler/testData/diagnostics/testsWithStdLib/typealias/typeAliasSamAdapterConstructors2.txt index d265f8fe024..3c04183ccbe 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/typealias/typeAliasSamAdapterConstructors2.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/typealias/typeAliasSamAdapterConstructors2.txt @@ -32,11 +32,6 @@ public open class JHost { public abstract fun run(): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } - - // Static members - public final /*synthesized*/ fun Consumer(/*0*/ function: (x: T!) -> kotlin.Unit): JHost.Consumer - public final /*synthesized*/ fun Consumer2(/*0*/ function: (x1: T1!, x2: T2!) -> kotlin.Unit): JHost.Consumer2 - public final /*synthesized*/ fun Runnable(/*0*/ function: () -> kotlin.Unit): JHost.Runnable } public typealias C = JHost.Consumer public typealias C2 = JHost.Consumer2 diff --git a/compiler/testData/loadJava/compiledJava/sam/Comparator.txt b/compiler/testData/loadJava/compiledJava/sam/Comparator.txt index 66e186f9db9..c5d5034beb1 100644 --- a/compiler/testData/loadJava/compiledJava/sam/Comparator.txt +++ b/compiler/testData/loadJava/compiledJava/sam/Comparator.txt @@ -1,7 +1,5 @@ package test -public /*synthesized*/ fun Comparator(/*0*/ function: (T!, T!) -> kotlin.Int): test.Comparator - public interface Comparator { public abstract fun compare(/*0*/ p0: T!, /*1*/ p1: T!): kotlin.Int } diff --git a/compiler/testData/loadJava/compiledJava/sam/FilenameFilter.txt b/compiler/testData/loadJava/compiledJava/sam/FilenameFilter.txt index 795cf6add89..9fad4b56b1e 100644 --- a/compiler/testData/loadJava/compiledJava/sam/FilenameFilter.txt +++ b/compiler/testData/loadJava/compiledJava/sam/FilenameFilter.txt @@ -1,7 +1,5 @@ package test -public /*synthesized*/ fun FilenameFilter(/*0*/ function: (java.io.File!, kotlin.String!) -> kotlin.Boolean): test.FilenameFilter - public interface FilenameFilter { public abstract fun accept(/*0*/ p0: java.io.File!, /*1*/ p1: kotlin.String!): kotlin.Boolean } diff --git a/compiler/testData/loadJava/compiledJava/sam/GenericInterfaceParameterWithSelfBound.txt b/compiler/testData/loadJava/compiledJava/sam/GenericInterfaceParameterWithSelfBound.txt index dcb712837b8..4bd8559000b 100644 --- a/compiler/testData/loadJava/compiledJava/sam/GenericInterfaceParameterWithSelfBound.txt +++ b/compiler/testData/loadJava/compiledJava/sam/GenericInterfaceParameterWithSelfBound.txt @@ -1,7 +1,5 @@ package test -public /*synthesized*/ fun !> GenericInterfaceParameterWithSelfBound(/*0*/ function: (T!) -> T!): test.GenericInterfaceParameterWithSelfBound - public interface GenericInterfaceParameterWithSelfBound!> { public abstract fun method(/*0*/ p0: T!): T! } diff --git a/compiler/testData/loadJava/compiledJava/sam/GenericInterfaceParametersWithBounds.txt b/compiler/testData/loadJava/compiledJava/sam/GenericInterfaceParametersWithBounds.txt index 57e5655039f..681b5b6ddfd 100644 --- a/compiler/testData/loadJava/compiledJava/sam/GenericInterfaceParametersWithBounds.txt +++ b/compiler/testData/loadJava/compiledJava/sam/GenericInterfaceParametersWithBounds.txt @@ -1,7 +1,5 @@ package test -public /*synthesized*/ fun !, /*1*/ B : kotlin.collections.(Mutable)List!> GenericInterfaceParametersWithBounds(/*0*/ function: (kotlin.Array<(out) A!>!, B!) -> kotlin.Unit): test.GenericInterfaceParametersWithBounds where A : kotlin.Cloneable! - public interface GenericInterfaceParametersWithBounds!, /*1*/ B : kotlin.collections.(Mutable)List!> where A : kotlin.Cloneable! { public abstract fun method(/*0*/ p0: kotlin.Array<(out) A!>!, /*1*/ p1: B!): kotlin.Unit } diff --git a/compiler/testData/loadJava/compiledJava/sam/Nested.txt b/compiler/testData/loadJava/compiledJava/sam/Nested.txt index 6314d7ac2ca..97a3808d930 100644 --- a/compiler/testData/loadJava/compiledJava/sam/Nested.txt +++ b/compiler/testData/loadJava/compiledJava/sam/Nested.txt @@ -15,15 +15,9 @@ public interface Nested { public interface Runnable { public abstract fun run(): kotlin.Unit } - - // Static members - public final /*synthesized*/ fun Runnable(/*0*/ function: () -> kotlin.Unit): test.Nested.Deeper2.Runnable } public interface Runnable { public abstract fun run(): kotlin.Unit } - - // Static members - public final /*synthesized*/ fun Runnable(/*0*/ function: () -> kotlin.Unit): test.Nested.Runnable } diff --git a/compiler/testData/loadJava/compiledJava/sam/Runnable.txt b/compiler/testData/loadJava/compiledJava/sam/Runnable.txt index e4853e7c257..dc772241b16 100644 --- a/compiler/testData/loadJava/compiledJava/sam/Runnable.txt +++ b/compiler/testData/loadJava/compiledJava/sam/Runnable.txt @@ -1,7 +1,5 @@ package test -public /*synthesized*/ fun Runnable(/*0*/ function: () -> kotlin.Unit): test.Runnable - public interface Runnable { public abstract fun run(): kotlin.Unit } diff --git a/compiler/testData/loadJava/compiledJava/sam/SamSubinterfaceOfTwo.txt b/compiler/testData/loadJava/compiledJava/sam/SamSubinterfaceOfTwo.txt index 7b160b2000d..2c86a2c390a 100644 --- a/compiler/testData/loadJava/compiledJava/sam/SamSubinterfaceOfTwo.txt +++ b/compiler/testData/loadJava/compiledJava/sam/SamSubinterfaceOfTwo.txt @@ -13,9 +13,4 @@ public interface SamSubinterfaceOfTwo { public interface Super2 { public abstract fun f(): T! } - - // Static members - public final /*synthesized*/ fun Sub(/*0*/ function: () -> kotlin.String!): test.SamSubinterfaceOfTwo.Sub - public final /*synthesized*/ fun Super1(/*0*/ function: () -> kotlin.CharSequence!): test.SamSubinterfaceOfTwo.Super1 - public final /*synthesized*/ fun Super2(/*0*/ function: () -> T!): test.SamSubinterfaceOfTwo.Super2 } diff --git a/compiler/testData/loadJava/compiledJava/sam/SamSubinterfaceOverridding.txt b/compiler/testData/loadJava/compiledJava/sam/SamSubinterfaceOverridding.txt index ff98fbe2474..22b1d0df200 100644 --- a/compiler/testData/loadJava/compiledJava/sam/SamSubinterfaceOverridding.txt +++ b/compiler/testData/loadJava/compiledJava/sam/SamSubinterfaceOverridding.txt @@ -1,7 +1,5 @@ package test -public /*synthesized*/ fun SamSubinterfaceOverridding(/*0*/ function: () -> kotlin.Unit): test.SamSubinterfaceOverridding - public interface SamSubinterfaceOverridding : java.lang.Runnable { public abstract override /*1*/ fun run(): kotlin.Unit } diff --git a/compiler/testData/loadJava/compiledJava/sam/SubstitutedSamInterface.txt b/compiler/testData/loadJava/compiledJava/sam/SubstitutedSamInterface.txt index 7d67437dacf..ac6f58080f8 100644 --- a/compiler/testData/loadJava/compiledJava/sam/SubstitutedSamInterface.txt +++ b/compiler/testData/loadJava/compiledJava/sam/SubstitutedSamInterface.txt @@ -1,7 +1,5 @@ package test -public /*synthesized*/ fun SubstitutedSamInterface(/*0*/ function: (kotlin.String!, kotlin.String!) -> kotlin.Int): test.SubstitutedSamInterface - public interface SubstitutedSamInterface : java.util.Comparator { public abstract override /*1*/ /*fake_override*/ fun compare(/*0*/ p0: kotlin.String!, /*1*/ p1: kotlin.String!): kotlin.Int } diff --git a/compiler/testData/loadJava/compiledJava/sam/SubstitutedSamInterfaceSubclassOfBuiltin.txt b/compiler/testData/loadJava/compiledJava/sam/SubstitutedSamInterfaceSubclassOfBuiltin.txt index 78631241226..fc3adc37b7f 100644 --- a/compiler/testData/loadJava/compiledJava/sam/SubstitutedSamInterfaceSubclassOfBuiltin.txt +++ b/compiler/testData/loadJava/compiledJava/sam/SubstitutedSamInterfaceSubclassOfBuiltin.txt @@ -1,7 +1,5 @@ package test -public /*synthesized*/ fun SubstitutedSamInterfaceSubclassOfBuiltin(/*0*/ function: (other: test.SubstitutedSamInterfaceSubclassOfBuiltin!) -> kotlin.Int): test.SubstitutedSamInterfaceSubclassOfBuiltin - public interface SubstitutedSamInterfaceSubclassOfBuiltin : kotlin.Comparable { public abstract override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: test.SubstitutedSamInterfaceSubclassOfBuiltin!): kotlin.Int } diff --git a/compiler/testData/loadJava/compiledJava/sam/VarargParameter.txt b/compiler/testData/loadJava/compiledJava/sam/VarargParameter.txt index b49c4ecdc10..a1999ee3373 100644 --- a/compiler/testData/loadJava/compiledJava/sam/VarargParameter.txt +++ b/compiler/testData/loadJava/compiledJava/sam/VarargParameter.txt @@ -1,7 +1,5 @@ package test -public /*synthesized*/ fun VarargParameter(/*0*/ function: (kotlin.Array<(out) kotlin.String!>!) -> kotlin.Unit): test.VarargParameter - public interface VarargParameter { public abstract fun f(/*0*/ vararg p0: kotlin.String! /*kotlin.Array<(out) kotlin.String!>!*/): kotlin.Unit } diff --git a/compiler/testData/loadJava/compiledJava/sam/adapters/DeepSamLoop.txt b/compiler/testData/loadJava/compiledJava/sam/adapters/DeepSamLoop.txt index 2ce50c9277a..9e8405487d2 100644 --- a/compiler/testData/loadJava/compiledJava/sam/adapters/DeepSamLoop.txt +++ b/compiler/testData/loadJava/compiledJava/sam/adapters/DeepSamLoop.txt @@ -9,8 +9,4 @@ public interface DeepSamLoop { public interface Foo { public abstract fun foo(/*0*/ p0: test.DeepSamLoop.Bar!): kotlin.Unit } - - // Static members - public final /*synthesized*/ fun Bar(/*0*/ function: (test.DeepSamLoop.Foo!) -> kotlin.Unit): test.DeepSamLoop.Bar - public final /*synthesized*/ fun Foo(/*0*/ function: (test.DeepSamLoop.Bar!) -> kotlin.Unit): test.DeepSamLoop.Foo } diff --git a/compiler/testData/loadJava/compiledJava/sam/adapters/PrivateSamAdapter.txt b/compiler/testData/loadJava/compiledJava/sam/adapters/PrivateSamAdapter.txt index 6ac60b670a1..f44dfeef236 100644 --- a/compiler/testData/loadJava/compiledJava/sam/adapters/PrivateSamAdapter.txt +++ b/compiler/testData/loadJava/compiledJava/sam/adapters/PrivateSamAdapter.txt @@ -7,7 +7,4 @@ public open class PrivateSamAdapter { private interface SamInterface { public abstract fun foo(): kotlin.Unit } - - // Static members - private final /*synthesized*/ fun SamInterface(/*0*/ function: () -> kotlin.Unit): test.PrivateSamAdapter.SamInterface } diff --git a/compiler/testData/loadJava/compiledJava/sam/adapters/SelfAsParameter.txt b/compiler/testData/loadJava/compiledJava/sam/adapters/SelfAsParameter.txt index 52c209c36d3..8c965567609 100644 --- a/compiler/testData/loadJava/compiledJava/sam/adapters/SelfAsParameter.txt +++ b/compiler/testData/loadJava/compiledJava/sam/adapters/SelfAsParameter.txt @@ -1,7 +1,5 @@ package test -public /*synthesized*/ fun SelfAsParameter(/*0*/ function: (test.SelfAsParameter!) -> kotlin.Unit): test.SelfAsParameter - public interface SelfAsParameter { public abstract fun foo(/*0*/ p0: test.SelfAsParameter!): kotlin.Unit } diff --git a/compiler/testData/loadJava/compiledJava/sam/adapters/inheritance/AdapterDoesntOverrideDeclaration.txt b/compiler/testData/loadJava/compiledJava/sam/adapters/inheritance/AdapterDoesntOverrideDeclaration.txt index fe176f0e97b..c3a1e67026b 100644 --- a/compiler/testData/loadJava/compiledJava/sam/adapters/inheritance/AdapterDoesntOverrideDeclaration.txt +++ b/compiler/testData/loadJava/compiledJava/sam/adapters/inheritance/AdapterDoesntOverrideDeclaration.txt @@ -10,7 +10,4 @@ public interface AdapterDoesntOverrideDeclaration { public interface Super { public abstract fun foo(/*0*/ p0: (() -> kotlin.Unit!)!): kotlin.Unit } - - // Static members - public final /*synthesized*/ fun Super(/*0*/ function: ((() -> kotlin.Unit!)!) -> kotlin.Unit): test.AdapterDoesntOverrideDeclaration.Super } diff --git a/compiler/testData/loadJava/compiledJava/sam/adapters/inheritance/InheritedSameAdapters.txt b/compiler/testData/loadJava/compiledJava/sam/adapters/inheritance/InheritedSameAdapters.txt index da0020bb56f..8e9ce41d1dd 100644 --- a/compiler/testData/loadJava/compiledJava/sam/adapters/inheritance/InheritedSameAdapters.txt +++ b/compiler/testData/loadJava/compiledJava/sam/adapters/inheritance/InheritedSameAdapters.txt @@ -13,9 +13,4 @@ public interface InheritedSameAdapters { public interface Super2 { public abstract fun foo(/*0*/ p0: java.lang.Runnable!): kotlin.Unit } - - // Static members - public final /*synthesized*/ fun Sub(/*0*/ function: (java.lang.Runnable!) -> kotlin.Unit): test.InheritedSameAdapters.Sub - public final /*synthesized*/ fun Super1(/*0*/ function: (java.lang.Runnable!) -> kotlin.Unit): test.InheritedSameAdapters.Super1 - public final /*synthesized*/ fun Super2(/*0*/ function: (java.lang.Runnable!) -> kotlin.Unit): test.InheritedSameAdapters.Super2 } diff --git a/compiler/testData/loadJava/compiledJava/sam/adapters/inheritance/InheritedSameAdaptersWithSubstitution.txt b/compiler/testData/loadJava/compiledJava/sam/adapters/inheritance/InheritedSameAdaptersWithSubstitution.txt index a6f5e3c4bdc..a8eb8f22370 100644 --- a/compiler/testData/loadJava/compiledJava/sam/adapters/inheritance/InheritedSameAdaptersWithSubstitution.txt +++ b/compiler/testData/loadJava/compiledJava/sam/adapters/inheritance/InheritedSameAdaptersWithSubstitution.txt @@ -17,10 +17,4 @@ public interface InheritedSameAdaptersWithSubstitution { public interface Super2Substituted : test.InheritedSameAdaptersWithSubstitution.Super2 { public abstract override /*1*/ /*fake_override*/ fun foo(/*0*/ p0: java.util.Comparator!): kotlin.Unit } - - // Static members - public final /*synthesized*/ fun Sub(/*0*/ function: (java.util.Comparator!) -> kotlin.Unit): test.InheritedSameAdaptersWithSubstitution.Sub - public final /*synthesized*/ fun Super1(/*0*/ function: (java.util.Comparator!) -> kotlin.Unit): test.InheritedSameAdaptersWithSubstitution.Super1 - public final /*synthesized*/ fun Super2(/*0*/ function: (java.util.Comparator!) -> kotlin.Unit): test.InheritedSameAdaptersWithSubstitution.Super2 - public final /*synthesized*/ fun Super2Substituted(/*0*/ function: (java.util.Comparator!) -> kotlin.Unit): test.InheritedSameAdaptersWithSubstitution.Super2Substituted } diff --git a/compiler/testData/loadJava/compiledJava/sam/adapters/inheritance/InheritedSimple.txt b/compiler/testData/loadJava/compiledJava/sam/adapters/inheritance/InheritedSimple.txt index cc18ba2098a..d789dfe9f00 100644 --- a/compiler/testData/loadJava/compiledJava/sam/adapters/inheritance/InheritedSimple.txt +++ b/compiler/testData/loadJava/compiledJava/sam/adapters/inheritance/InheritedSimple.txt @@ -9,8 +9,4 @@ public interface InheritedSimple { public interface Super { public abstract fun foo(/*0*/ p0: java.lang.Runnable!): kotlin.Unit } - - // Static members - public final /*synthesized*/ fun Sub(/*0*/ function: (java.lang.Runnable!) -> kotlin.Unit): test.InheritedSimple.Sub - public final /*synthesized*/ fun Super(/*0*/ function: (java.lang.Runnable!) -> kotlin.Unit): test.InheritedSimple.Super } diff --git a/compiler/testData/loadJava/compiledJavaAndKotlin/MixedPackage.txt b/compiler/testData/loadJava/compiledJavaAndKotlin/MixedPackage.txt index 9096a739c7a..08f314c5f4b 100644 --- a/compiler/testData/loadJava/compiledJavaAndKotlin/MixedPackage.txt +++ b/compiler/testData/loadJava/compiledJavaAndKotlin/MixedPackage.txt @@ -1,6 +1,5 @@ package test -public /*synthesized*/ fun SamInterface(/*0*/ function: () -> kotlin.Unit): test.SamInterface public fun topLevelFunction(): kotlin.Unit public open class JavaClass { diff --git a/compiler/testData/loadJava/kotlinAgainstCompiledJavaWithKotlin/InheritParameterName.txt b/compiler/testData/loadJava/kotlinAgainstCompiledJavaWithKotlin/InheritParameterName.txt index 02113b84915..7a9abc511c8 100644 --- a/compiler/testData/loadJava/kotlinAgainstCompiledJavaWithKotlin/InheritParameterName.txt +++ b/compiler/testData/loadJava/kotlinAgainstCompiledJavaWithKotlin/InheritParameterName.txt @@ -1,7 +1,5 @@ package test -public /*synthesized*/ fun A(/*0*/ function: (kotlin.Int) -> kotlin.Unit): test.A - public interface A { public abstract fun foo(/*0*/ p0: kotlin.Int): kotlin.Unit } diff --git a/compiler/testData/loadJava/kotlinAgainstCompiledJavaWithKotlin/javaRefersToKotlin.txt b/compiler/testData/loadJava/kotlinAgainstCompiledJavaWithKotlin/javaRefersToKotlin.txt index f20f84e739b..78a201e4ad1 100644 --- a/compiler/testData/loadJava/kotlinAgainstCompiledJavaWithKotlin/javaRefersToKotlin.txt +++ b/compiler/testData/loadJava/kotlinAgainstCompiledJavaWithKotlin/javaRefersToKotlin.txt @@ -1,7 +1,5 @@ package test -public /*synthesized*/ fun J(/*0*/ function: (test.K!) -> kotlin.Unit): test.J - public interface J { public abstract fun foo(/*0*/ p0: test.K!): kotlin.Unit } diff --git a/compiler/testData/loadJava/sourceJava/NullInAnnotation.txt b/compiler/testData/loadJava/sourceJava/NullInAnnotation.txt index 932dadfd12a..096ba87b729 100644 --- a/compiler/testData/loadJava/sourceJava/NullInAnnotation.txt +++ b/compiler/testData/loadJava/sourceJava/NullInAnnotation.txt @@ -1,7 +1,5 @@ package test -public /*synthesized*/ fun NullInAnnotation(/*0*/ function: () -> kotlin.Unit): test.NullInAnnotation - public interface NullInAnnotation { @test.NullInAnnotation.Ann(a = null, b = {null}) public abstract fun foo(): kotlin.Unit diff --git a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaPackageScope.kt b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaPackageScope.kt index 17a9d2201fe..65552c9df74 100644 --- a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaPackageScope.kt +++ b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaPackageScope.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2015 JetBrains s.r.o. + * Copyright 2010-2017 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import org.jetbrains.kotlin.descriptors.PropertyDescriptor import org.jetbrains.kotlin.descriptors.SimpleFunctionDescriptor import org.jetbrains.kotlin.incremental.components.LookupLocation import org.jetbrains.kotlin.incremental.components.NoLookupLocation -import org.jetbrains.kotlin.load.java.descriptors.SamConstructorDescriptorKindExclude import org.jetbrains.kotlin.load.java.lazy.LazyJavaResolverContext import org.jetbrains.kotlin.load.java.structure.JavaClass import org.jetbrains.kotlin.load.java.structure.JavaPackage @@ -32,7 +31,6 @@ import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader import org.jetbrains.kotlin.name.ClassId import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.name.SpecialNames -import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter import org.jetbrains.kotlin.storage.NullableLazyValue import org.jetbrains.kotlin.utils.alwaysTrue @@ -153,17 +151,10 @@ class LazyJavaPackageScope( } override fun computeFunctionNames(kindFilter: DescriptorKindFilter, nameFilter: ((Name) -> Boolean)?): Set { - // optimization: only SAM-constructors may exist in java package - if (kindFilter.excludes.contains(SamConstructorDescriptorKindExclude)) return emptySet() - - // For SAM-constructors - return computeClassNames(DescriptorKindFilter.CLASSIFIERS, nameFilter) + return emptySet() } override fun computeNonDeclaredFunctions(result: MutableCollection, name: Name) { - c.components.samConversionResolver.resolveSamConstructor(ownerDescriptor) { - getContributedClassifier(name, NoLookupLocation.FOR_ALREADY_TRACKED) - }?.let { result.add(it) } } override fun computePropertyNames(kindFilter: DescriptorKindFilter, nameFilter: ((Name) -> Boolean)?) = emptySet() diff --git a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaStaticClassScope.kt b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaStaticClassScope.kt index f1df772183c..ae243176a7e 100644 --- a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaStaticClassScope.kt +++ b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaStaticClassScope.kt @@ -64,10 +64,6 @@ class LazyJavaStaticClassScope( } override fun computeNonDeclaredFunctions(result: MutableCollection, name: Name) { - c.components.samConversionResolver.resolveSamConstructor(ownerDescriptor) { - ownerDescriptor.unsubstitutedInnerClassesScope.getContributedClassifier(name, NoLookupLocation.FOR_ALREADY_TRACKED) - }?.let { result.add(it) } - val functionsFromSupertypes = getStaticFunctionsFromJavaSuperClasses(name, ownerDescriptor) result.addAll(resolveOverridesForStaticMembers(name, functionsFromSupertypes, result, ownerDescriptor, c.components.errorReporter)) diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/noParameters.txt b/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/noParameters.txt index 07bf5a350d5..09351d5e22d 100644 --- a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/noParameters.txt +++ b/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/noParameters.txt @@ -1,6 +1,5 @@ package -@SamWithReceiver public /*synthesized*/ fun Sam(/*0*/ function: () -> kotlin.Unit): Sam public fun test(): kotlin.Unit @SamWithReceiver public interface Sam { diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/noReturnType.txt b/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/noReturnType.txt index 171248f8423..732e64de71b 100644 --- a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/noReturnType.txt +++ b/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/noReturnType.txt @@ -1,6 +1,5 @@ package -@SamWithReceiver public /*synthesized*/ fun Sam(/*0*/ function: kotlin.String!.(b: kotlin.String!) -> kotlin.Unit): Sam public fun test(): kotlin.Unit @SamWithReceiver public interface Sam { diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samConversionNoParameters.txt b/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samConversionNoParameters.txt index f614db4b1d0..44aebc22473 100644 --- a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samConversionNoParameters.txt +++ b/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samConversionNoParameters.txt @@ -1,6 +1,5 @@ package -@SamWithReceiver public /*synthesized*/ fun Sam(/*0*/ function: () -> kotlin.Unit): Sam public fun test(): kotlin.Unit public open class Exec { diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samConversionSimple.txt b/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samConversionSimple.txt index 679648bd4d7..5686d9a78f0 100644 --- a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samConversionSimple.txt +++ b/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samConversionSimple.txt @@ -1,6 +1,5 @@ package -@SamWithReceiver public /*synthesized*/ fun Sam(/*0*/ function: kotlin.String!.() -> kotlin.Unit): Sam public fun test(): kotlin.Unit public open class Exec { diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samConversionSimpleWithoutAnnotation.txt b/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samConversionSimpleWithoutAnnotation.txt index 0e2dbb8b8f2..7b4f5486250 100644 --- a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samConversionSimpleWithoutAnnotation.txt +++ b/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samConversionSimpleWithoutAnnotation.txt @@ -1,6 +1,5 @@ package -public /*synthesized*/ fun Sam(/*0*/ function: (a: kotlin.String!) -> kotlin.Unit): Sam public fun test(): kotlin.Unit public open class Exec { diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samWithAnnotation.txt b/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samWithAnnotation.txt index 7b6b056f258..348b72e16bc 100644 --- a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samWithAnnotation.txt +++ b/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samWithAnnotation.txt @@ -1,6 +1,5 @@ package -@SamWithReceiver public /*synthesized*/ fun Sam(/*0*/ function: kotlin.String!.(b: kotlin.String!) -> kotlin.String!): Sam public fun test(): kotlin.Unit @SamWithReceiver public interface Sam { diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samWithoutAnnotation.txt b/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samWithoutAnnotation.txt index 6af794d5bb6..7130d649562 100644 --- a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samWithoutAnnotation.txt +++ b/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samWithoutAnnotation.txt @@ -1,6 +1,5 @@ package -public /*synthesized*/ fun Sam(/*0*/ function: (a: kotlin.String!, b: kotlin.String!) -> kotlin.String!): Sam public fun test(): kotlin.Unit public interface Sam { diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/singleParameter.txt b/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/singleParameter.txt index ab4b0cf36a8..79a3df990e1 100644 --- a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/singleParameter.txt +++ b/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/singleParameter.txt @@ -1,6 +1,5 @@ package -@SamWithReceiver public /*synthesized*/ fun Sam(/*0*/ function: kotlin.String!.() -> kotlin.Unit): Sam public fun test(): kotlin.Unit @SamWithReceiver public interface Sam { diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/singleParameterWithoutAnnotation.txt b/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/singleParameterWithoutAnnotation.txt index 628ac00a7d0..fb30fe1a890 100644 --- a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/singleParameterWithoutAnnotation.txt +++ b/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/singleParameterWithoutAnnotation.txt @@ -1,6 +1,5 @@ package -public /*synthesized*/ fun Sam(/*0*/ function: (a: kotlin.String!) -> kotlin.Unit): Sam public fun test(): kotlin.Unit public interface Sam { diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/script/samConversionSimple.txt b/plugins/sam-with-receiver/sam-with-receiver-cli/testData/script/samConversionSimple.txt index f20d9436d4a..b980ba83850 100644 --- a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/script/samConversionSimple.txt +++ b/plugins/sam-with-receiver/sam-with-receiver-cli/testData/script/samConversionSimple.txt @@ -1,7 +1,5 @@ package -@SamWithReceiver1 public /*synthesized*/ fun Sam(/*0*/ function: (a: kotlin.String!) -> kotlin.Unit): Sam - public open class Exec { public constructor Exec() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean