From 3acb64c53698c9ef35be3c69a15d8e9c6a5efd8f Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Wed, 25 Mar 2020 17:17:56 +0300 Subject: [PATCH] [FIR] Add flexible default upper bound for java type parameters --- .../signatureAnnotations/DefaultNull.fir.txt | 4 ++-- .../kotlin/fir/java/JavaSymbolProvider.kt | 2 +- .../kotlin/fir/declarations/FirDeclarationUtil.kt | 14 ++++++++++++-- .../loadJava/compiledJava/ClassWithTypeP.fir.txt | 4 ++-- .../ClassWithTypePExtendsIterableP.fir.txt | 4 ++-- .../loadJava/compiledJava/ClassWithTypePP.fir.txt | 4 ++-- .../compiledJava/ClassWithTypePRefNext.fir.txt | 4 ++-- .../InnerClassReferencesOuterTP.fir.txt | 4 ++-- .../compiledJava/InnerClassesInGeneric.fir.txt | 4 ++-- .../MethodReferencesOuterClassTP.fir.txt | 4 ++-- .../loadJava/compiledJava/MethodWithTypeP.fir.txt | 2 +- .../loadJava/compiledJava/MethodWithTypePP.fir.txt | 2 +- .../compiledJava/MethodWithTypePRefClassP.fir.txt | 4 ++-- .../loadJava/compiledJava/MethosWithPRefTP.fir.txt | 2 +- .../constructor/ConstructorGenericDeep.fir.txt | 2 +- .../constructor/ConstructorGenericSimple.fir.txt | 2 +- .../javaBean/JavaBeanVarOfGenericType.fir.txt | 4 ++-- .../ConstructorWithNewTypeParams.fir.txt | 4 ++-- .../ConstructorWithParentTypeParams.fir.txt | 4 ++-- .../MethodWithMappedClasses.fir.txt | 4 ++-- .../MethodWithTypeParameters.fir.txt | 2 +- .../kotlinSignature/PropertyArrayTypes.fir.txt | 4 ++-- .../kotlinSignature/PropertyComplexTypes.fir.txt | 4 ++-- .../WrongTypeParameterBoundStructure1.fir.txt | 2 +- .../return/SubclassOfCollection.fir.txt | 2 +- .../propagation/return/SubclassOfMapEntry.fir.txt | 2 +- .../compiledJava/library/LoadIterable.fir.txt | 2 +- .../compiledJava/library/LoadIterator.fir.txt | 2 +- .../compiledJava/mutability/LoadIterable.fir.txt | 2 +- .../mutability/LoadIterableWithConflict.fir.txt | 2 +- .../mutability/LoadIterableWithNullability.fir.txt | 2 +- .../loadJava/compiledJava/sam/Comparator.fir.txt | 2 +- .../sam/adapters/TypeParameterOfClass.fir.txt | 4 ++-- .../sam/adapters/TypeParameterOfMethod.fir.txt | 2 +- .../sam/adapters/TypeParameterOfOuterClass.fir.txt | 4 ++-- 35 files changed, 63 insertions(+), 53 deletions(-) diff --git a/compiler/fir/analysis-tests/testData/enhancement/signatureAnnotations/DefaultNull.fir.txt b/compiler/fir/analysis-tests/testData/enhancement/signatureAnnotations/DefaultNull.fir.txt index 7e9eb58f7de..1243895032e 100644 --- a/compiler/fir/analysis-tests/testData/enhancement/signatureAnnotations/DefaultNull.fir.txt +++ b/compiler/fir/analysis-tests/testData/enhancement/signatureAnnotations/DefaultNull.fir.txt @@ -6,9 +6,9 @@ public open class A : R|kotlin/Any| { public constructor(): R|A| } -public open class B : R|kotlin/Any| { +public open class B!|> : R|kotlin/Any| { public open fun foo(@R|kotlin/annotations/jvm/internal/DefaultNull|() t: R|ft!| = Null(null)): R|kotlin/Unit| - public constructor(): R|B| + public constructor!|>(): R|B| } diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaSymbolProvider.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaSymbolProvider.kt index 08c5ebe5372..7cd47794450 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaSymbolProvider.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaSymbolProvider.kt @@ -113,7 +113,7 @@ class JavaSymbolProvider( forTypeParameterBounds = true ) } - addDefaultBoundIfNecessary() + addDefaultBoundIfNecessary(isFlexible = true) } private fun List.convertTypeParameters(stack: JavaTypeParameterStack): List { diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirDeclarationUtil.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirDeclarationUtil.kt index 8bb16f7e451..ca90568d98e 100644 --- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirDeclarationUtil.kt +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirDeclarationUtil.kt @@ -12,11 +12,21 @@ import org.jetbrains.kotlin.fir.symbols.impl.FirAnonymousObjectSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol import org.jetbrains.kotlin.fir.types.ConeClassLikeType +import org.jetbrains.kotlin.fir.types.ConeFlexibleType +import org.jetbrains.kotlin.fir.types.builder.buildResolvedTypeRef import org.jetbrains.kotlin.fir.types.coneTypeSafe -fun FirTypeParameterBuilder.addDefaultBoundIfNecessary() { +fun FirTypeParameterBuilder.addDefaultBoundIfNecessary(isFlexible: Boolean = false) { if (bounds.isEmpty()) { - bounds += session.builtinTypes.nullableAnyType + val type = if (isFlexible) { + val session = this.session + buildResolvedTypeRef { + type = ConeFlexibleType(session.builtinTypes.anyType.type, session.builtinTypes.nullableAnyType.type) + } + } else { + session.builtinTypes.nullableAnyType + } + bounds += type } } diff --git a/compiler/testData/loadJava/compiledJava/ClassWithTypeP.fir.txt b/compiler/testData/loadJava/compiledJava/ClassWithTypeP.fir.txt index d62fc3e3904..9dabecdf123 100644 --- a/compiler/testData/loadJava/compiledJava/ClassWithTypeP.fir.txt +++ b/compiler/testData/loadJava/compiledJava/ClassWithTypeP.fir.txt @@ -1,4 +1,4 @@ -public final class ClassWithTypeP

: R|kotlin/Any| { - public constructor

(): R|test/ClassWithTypeP

| +public final class ClassWithTypeP

!|> : R|kotlin/Any| { + public constructor

!|>(): R|test/ClassWithTypeP

| } diff --git a/compiler/testData/loadJava/compiledJava/ClassWithTypePExtendsIterableP.fir.txt b/compiler/testData/loadJava/compiledJava/ClassWithTypePExtendsIterableP.fir.txt index e505143535b..8ae833f484d 100644 --- a/compiler/testData/loadJava/compiledJava/ClassWithTypePExtendsIterableP.fir.txt +++ b/compiler/testData/loadJava/compiledJava/ClassWithTypePExtendsIterableP.fir.txt @@ -1,4 +1,4 @@ -public abstract class ClassWithTypePExtendsIterableP

: R|kotlin/Any|, R|kotlin/collections/MutableIterable!>| { - public constructor

(): R|test/ClassWithTypePExtendsIterableP

| +public abstract class ClassWithTypePExtendsIterableP

!|> : R|kotlin/Any|, R|kotlin/collections/MutableIterable!>| { + public constructor

!|>(): R|test/ClassWithTypePExtendsIterableP

| } diff --git a/compiler/testData/loadJava/compiledJava/ClassWithTypePP.fir.txt b/compiler/testData/loadJava/compiledJava/ClassWithTypePP.fir.txt index 8d0dcce66c5..a273382fd72 100644 --- a/compiler/testData/loadJava/compiledJava/ClassWithTypePP.fir.txt +++ b/compiler/testData/loadJava/compiledJava/ClassWithTypePP.fir.txt @@ -1,4 +1,4 @@ -public final class ClassWithTypePP!|> : R|kotlin/Any| { - public constructor!|>(): R|test/ClassWithTypePP| +public final class ClassWithTypePP

!|, Q : R|ft!|> : R|kotlin/Any| { + public constructor

!|, Q : R|ft!|>(): R|test/ClassWithTypePP| } diff --git a/compiler/testData/loadJava/compiledJava/ClassWithTypePRefNext.fir.txt b/compiler/testData/loadJava/compiledJava/ClassWithTypePRefNext.fir.txt index 14a0ca28f25..305d940481d 100644 --- a/compiler/testData/loadJava/compiledJava/ClassWithTypePRefNext.fir.txt +++ b/compiler/testData/loadJava/compiledJava/ClassWithTypePRefNext.fir.txt @@ -1,4 +1,4 @@ -public open class ClassWithTypePRefNext!>, kotlin/collections/Iterable!>?>!|, P> : R|kotlin/Any| { - public constructor!>, kotlin/collections/Iterable!>?>!|, P>(): R|test/ClassWithTypePRefNext| +public open class ClassWithTypePRefNext!>, kotlin/collections/Iterable!>?>!|, P : R|ft!|> : R|kotlin/Any| { + public constructor!>, kotlin/collections/Iterable!>?>!|, P : R|ft!|>(): R|test/ClassWithTypePRefNext| } diff --git a/compiler/testData/loadJava/compiledJava/InnerClassReferencesOuterTP.fir.txt b/compiler/testData/loadJava/compiledJava/InnerClassReferencesOuterTP.fir.txt index c6d3bfa061f..b11ab3f3c77 100644 --- a/compiler/testData/loadJava/compiledJava/InnerClassReferencesOuterTP.fir.txt +++ b/compiler/testData/loadJava/compiledJava/InnerClassReferencesOuterTP.fir.txt @@ -1,4 +1,4 @@ -public open class InnerClassReferencesOuterTP

: R|kotlin/Any| { - public constructor

(): R|test/InnerClassReferencesOuterTP

| +public open class InnerClassReferencesOuterTP

!|> : R|kotlin/Any| { + public constructor

!|>(): R|test/InnerClassReferencesOuterTP

| } diff --git a/compiler/testData/loadJava/compiledJava/InnerClassesInGeneric.fir.txt b/compiler/testData/loadJava/compiledJava/InnerClassesInGeneric.fir.txt index 2a458093c96..80e18dce961 100644 --- a/compiler/testData/loadJava/compiledJava/InnerClassesInGeneric.fir.txt +++ b/compiler/testData/loadJava/compiledJava/InnerClassesInGeneric.fir.txt @@ -1,4 +1,4 @@ -public open class InnerClassesInGeneric : R|kotlin/Any| { - public constructor(): R|test/InnerClassesInGeneric| +public open class InnerClassesInGeneric

!|, Q : R|ft!|> : R|kotlin/Any| { + public constructor

!|, Q : R|ft!|>(): R|test/InnerClassesInGeneric| } diff --git a/compiler/testData/loadJava/compiledJava/MethodReferencesOuterClassTP.fir.txt b/compiler/testData/loadJava/compiledJava/MethodReferencesOuterClassTP.fir.txt index 1243ccb9514..2076bfa9685 100644 --- a/compiler/testData/loadJava/compiledJava/MethodReferencesOuterClassTP.fir.txt +++ b/compiler/testData/loadJava/compiledJava/MethodReferencesOuterClassTP.fir.txt @@ -1,4 +1,4 @@ -public final class MethodReferencesOuterClassTP

: R|kotlin/Any| { - public constructor

(): R|test/MethodReferencesOuterClassTP

| +public final class MethodReferencesOuterClassTP

!|> : R|kotlin/Any| { + public constructor

!|>(): R|test/MethodReferencesOuterClassTP

| } diff --git a/compiler/testData/loadJava/compiledJava/MethodWithTypeP.fir.txt b/compiler/testData/loadJava/compiledJava/MethodWithTypeP.fir.txt index 92da7df8d29..5763e8d0aaf 100644 --- a/compiler/testData/loadJava/compiledJava/MethodWithTypeP.fir.txt +++ b/compiler/testData/loadJava/compiledJava/MethodWithTypeP.fir.txt @@ -1,5 +1,5 @@ public final class MethodWithTypeP : R|kotlin/Any| { - public final fun

f(): R|kotlin/Unit| + public final fun

!|> f(): R|kotlin/Unit| public constructor(): R|test/MethodWithTypeP| diff --git a/compiler/testData/loadJava/compiledJava/MethodWithTypePP.fir.txt b/compiler/testData/loadJava/compiledJava/MethodWithTypePP.fir.txt index 8f3262a2adf..bf6866d07bc 100644 --- a/compiler/testData/loadJava/compiledJava/MethodWithTypePP.fir.txt +++ b/compiler/testData/loadJava/compiledJava/MethodWithTypePP.fir.txt @@ -1,5 +1,5 @@ public final class MethodWithTypePP : R|kotlin/Any| { - public final fun !|> f(): R|kotlin/Unit| + public final fun

!|, Q : R|ft!|> f(): R|kotlin/Unit| public constructor(): R|test/MethodWithTypePP| diff --git a/compiler/testData/loadJava/compiledJava/MethodWithTypePRefClassP.fir.txt b/compiler/testData/loadJava/compiledJava/MethodWithTypePRefClassP.fir.txt index a8e64b40a8f..2472e98c2d2 100644 --- a/compiler/testData/loadJava/compiledJava/MethodWithTypePRefClassP.fir.txt +++ b/compiler/testData/loadJava/compiledJava/MethodWithTypePRefClassP.fir.txt @@ -1,6 +1,6 @@ -public open class MethodWithTypePRefClassP

: R|kotlin/Any| { +public open class MethodWithTypePRefClassP

!|> : R|kotlin/Any| { public final fun !|> f(): R|kotlin/Unit| - public constructor

(): R|test/MethodWithTypePRefClassP

| + public constructor

!|>(): R|test/MethodWithTypePRefClassP

| } diff --git a/compiler/testData/loadJava/compiledJava/MethosWithPRefTP.fir.txt b/compiler/testData/loadJava/compiledJava/MethosWithPRefTP.fir.txt index e336c8b1e4b..2ccb6cc4d3b 100644 --- a/compiler/testData/loadJava/compiledJava/MethosWithPRefTP.fir.txt +++ b/compiler/testData/loadJava/compiledJava/MethosWithPRefTP.fir.txt @@ -1,5 +1,5 @@ public final class MethosWithPRefTP : R|kotlin/Any| { - public final fun

f(p: R|ft!|): R|kotlin/Unit| + public final fun

!|> f(p: R|ft!|): R|kotlin/Unit| public constructor(): R|test/MethosWithPRefTP| diff --git a/compiler/testData/loadJava/compiledJava/constructor/ConstructorGenericDeep.fir.txt b/compiler/testData/loadJava/compiledJava/constructor/ConstructorGenericDeep.fir.txt index 7acd79cffb7..acc451ca9f7 100644 --- a/compiler/testData/loadJava/compiledJava/constructor/ConstructorGenericDeep.fir.txt +++ b/compiler/testData/loadJava/compiledJava/constructor/ConstructorGenericDeep.fir.txt @@ -1,4 +1,4 @@ public open class ConstructorGenericDeep : R|kotlin/Any| { - public constructor

(cl: R|ft!>, java/lang/Class!>?>!|): R|test/ConstructorGenericDeep| + public constructor

!|>(cl: R|ft!>, java/lang/Class!>?>!|): R|test/ConstructorGenericDeep| } diff --git a/compiler/testData/loadJava/compiledJava/constructor/ConstructorGenericSimple.fir.txt b/compiler/testData/loadJava/compiledJava/constructor/ConstructorGenericSimple.fir.txt index 24691d7a3a3..1062303dde0 100644 --- a/compiler/testData/loadJava/compiledJava/constructor/ConstructorGenericSimple.fir.txt +++ b/compiler/testData/loadJava/compiledJava/constructor/ConstructorGenericSimple.fir.txt @@ -1,4 +1,4 @@ public open class ConstructorGenericSimple : R|kotlin/Any| { - public constructor

(p: R|ft!|): R|test/ConstructorGenericSimple| + public constructor

!|>(p: R|ft!|): R|test/ConstructorGenericSimple| } diff --git a/compiler/testData/loadJava/compiledJava/javaBean/JavaBeanVarOfGenericType.fir.txt b/compiler/testData/loadJava/compiledJava/javaBean/JavaBeanVarOfGenericType.fir.txt index dbcd5cc485a..09ed70585c6 100644 --- a/compiler/testData/loadJava/compiledJava/javaBean/JavaBeanVarOfGenericType.fir.txt +++ b/compiler/testData/loadJava/compiledJava/javaBean/JavaBeanVarOfGenericType.fir.txt @@ -1,8 +1,8 @@ -public open class JavaBeanVarOfGenericType

: R|kotlin/Any| { +public open class JavaBeanVarOfGenericType

!|> : R|kotlin/Any| { public open fun getCharacters(): R|ft!>, java/util/ArrayList!>?>!| public open fun setCharacters(characters: R|ft!>, java/util/ArrayList!>?>!|): R|kotlin/Unit| - public constructor

(): R|test/JavaBeanVarOfGenericType

| + public constructor

!|>(): R|test/JavaBeanVarOfGenericType

| } diff --git a/compiler/testData/loadJava/compiledJava/kotlinSignature/ConstructorWithNewTypeParams.fir.txt b/compiler/testData/loadJava/compiledJava/kotlinSignature/ConstructorWithNewTypeParams.fir.txt index 12948c9f245..0ef2f13d500 100644 --- a/compiler/testData/loadJava/compiledJava/kotlinSignature/ConstructorWithNewTypeParams.fir.txt +++ b/compiler/testData/loadJava/compiledJava/kotlinSignature/ConstructorWithNewTypeParams.fir.txt @@ -1,4 +1,4 @@ -public open class ConstructorWithNewTypeParams : R|kotlin/Any| { - public constructor(first: R|ft!|): R|test/ConstructorWithNewTypeParams| +public open class ConstructorWithNewTypeParams!|> : R|kotlin/Any| { + public constructor!|, U : R|ft!|>(first: R|ft!|): R|test/ConstructorWithNewTypeParams| } diff --git a/compiler/testData/loadJava/compiledJava/kotlinSignature/ConstructorWithParentTypeParams.fir.txt b/compiler/testData/loadJava/compiledJava/kotlinSignature/ConstructorWithParentTypeParams.fir.txt index 7c2b0fb8a43..d06169dbbb9 100644 --- a/compiler/testData/loadJava/compiledJava/kotlinSignature/ConstructorWithParentTypeParams.fir.txt +++ b/compiler/testData/loadJava/compiledJava/kotlinSignature/ConstructorWithParentTypeParams.fir.txt @@ -1,4 +1,4 @@ -public open class ConstructorWithParentTypeParams : R|kotlin/Any| { - public constructor(first: R|ft!|): R|test/ConstructorWithParentTypeParams| +public open class ConstructorWithParentTypeParams!|> : R|kotlin/Any| { + public constructor!|>(first: R|ft!|): R|test/ConstructorWithParentTypeParams| } diff --git a/compiler/testData/loadJava/compiledJava/kotlinSignature/MethodWithMappedClasses.fir.txt b/compiler/testData/loadJava/compiledJava/kotlinSignature/MethodWithMappedClasses.fir.txt index 20ae8fef5bc..28c7ec5e4fa 100644 --- a/compiler/testData/loadJava/compiledJava/kotlinSignature/MethodWithMappedClasses.fir.txt +++ b/compiler/testData/loadJava/compiledJava/kotlinSignature/MethodWithMappedClasses.fir.txt @@ -1,7 +1,7 @@ public open class MethodWithMappedClasses : R|kotlin/Any| { - public open fun copy(dest: R|ft!>, kotlin/collections/List!>?>!|, src: R|ft!>, kotlin/collections/List!>?>!|): R|kotlin/Unit| + public open fun !|> copy(dest: R|ft!>, kotlin/collections/List!>?>!|, src: R|ft!>, kotlin/collections/List!>?>!|): R|kotlin/Unit| - public open fun copyMap(dest: R|ft!, in ft!>, kotlin/collections/Map!, in ft!>?>!|, src: R|ft!, ft!>, kotlin/collections/Map!, ft!>?>!|): R|kotlin/Unit| + public open fun !|> copyMap(dest: R|ft!, in ft!>, kotlin/collections/Map!, in ft!>?>!|, src: R|ft!, ft!>, kotlin/collections/Map!, ft!>?>!|): R|kotlin/Unit| public constructor(): R|test/MethodWithMappedClasses| diff --git a/compiler/testData/loadJava/compiledJava/kotlinSignature/MethodWithTypeParameters.fir.txt b/compiler/testData/loadJava/compiledJava/kotlinSignature/MethodWithTypeParameters.fir.txt index b438105e8af..dccc0ba9c57 100644 --- a/compiler/testData/loadJava/compiledJava/kotlinSignature/MethodWithTypeParameters.fir.txt +++ b/compiler/testData/loadJava/compiledJava/kotlinSignature/MethodWithTypeParameters.fir.txt @@ -1,5 +1,5 @@ public open class MethodWithTypeParameters : R|kotlin/Any| { - public open fun !|, R|ft!>, kotlin/collections/List!>?>!|> foo(a: R|ft!|, b: R|ft!>, kotlin/collections/List!>?>!|, list: R|ft!>, kotlin/collections/List!>?>!|): R|kotlin/Unit| + public open fun !|, B : R|ft!|, R|ft!>, kotlin/collections/List!>?>!|> foo(a: R|ft!|, b: R|ft!>, kotlin/collections/List!>?>!|, list: R|ft!>, kotlin/collections/List!>?>!|): R|kotlin/Unit| public constructor(): R|test/MethodWithTypeParameters| diff --git a/compiler/testData/loadJava/compiledJava/kotlinSignature/PropertyArrayTypes.fir.txt b/compiler/testData/loadJava/compiledJava/kotlinSignature/PropertyArrayTypes.fir.txt index 3a33b325092..ef8d624fe81 100644 --- a/compiler/testData/loadJava/compiledJava/kotlinSignature/PropertyArrayTypes.fir.txt +++ b/compiler/testData/loadJava/compiledJava/kotlinSignature/PropertyArrayTypes.fir.txt @@ -1,10 +1,10 @@ -public open class PropertyArrayTypes : R|kotlin/Any| { +public open class PropertyArrayTypes!|> : R|kotlin/Any| { public open field arrayOfArrays: R|ft!>, kotlin/Array!>?>!>, kotlin/Array!>, kotlin/Array!>?>!>?>!| public open field array: R|ft!>, kotlin/Array!>?>!| public open field genericArray: R|ft!>, kotlin/Array!>?>!| - public constructor(): R|test/PropertyArrayTypes| + public constructor!|>(): R|test/PropertyArrayTypes| } diff --git a/compiler/testData/loadJava/compiledJava/kotlinSignature/PropertyComplexTypes.fir.txt b/compiler/testData/loadJava/compiledJava/kotlinSignature/PropertyComplexTypes.fir.txt index adb4b84dde3..2ed4dd1f94a 100644 --- a/compiler/testData/loadJava/compiledJava/kotlinSignature/PropertyComplexTypes.fir.txt +++ b/compiler/testData/loadJava/compiledJava/kotlinSignature/PropertyComplexTypes.fir.txt @@ -1,4 +1,4 @@ -public open class PropertyComplexTypes : R|kotlin/Any| { +public open class PropertyComplexTypes!|> : R|kotlin/Any| { public open field genericType: R|ft!| public open field listDefinedGeneric: R|ft!>, java/util/ArrayList!>?>!| @@ -7,6 +7,6 @@ public open class PropertyComplexTypes : R|kotlin/Any| { public open field listOfGenericList: R|ft!>, java/util/ArrayList!>?>!>, java/util/ArrayList!>, java/util/ArrayList!>?>!>?>!| - public constructor(): R|test/PropertyComplexTypes| + public constructor!|>(): R|test/PropertyComplexTypes| } diff --git a/compiler/testData/loadJava/compiledJava/kotlinSignature/error/WrongTypeParameterBoundStructure1.fir.txt b/compiler/testData/loadJava/compiledJava/kotlinSignature/error/WrongTypeParameterBoundStructure1.fir.txt index f8522b8b57f..2f8e39f04a3 100644 --- a/compiler/testData/loadJava/compiledJava/kotlinSignature/error/WrongTypeParameterBoundStructure1.fir.txt +++ b/compiler/testData/loadJava/compiledJava/kotlinSignature/error/WrongTypeParameterBoundStructure1.fir.txt @@ -1,5 +1,5 @@ public open class WrongTypeParameterBoundStructure1 : R|kotlin/Any| { - public open fun !|, R|ft!>, kotlin/collections/List!>?>!|> foo(a: R|ft!|, b: R|ft!>, kotlin/collections/List!>?>!|): R|kotlin/Unit| + public open fun !|, B : R|ft!|, R|ft!>, kotlin/collections/List!>?>!|> foo(a: R|ft!|, b: R|ft!>, kotlin/collections/List!>?>!|): R|kotlin/Unit| public constructor(): R|test/WrongTypeParameterBoundStructure1| diff --git a/compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/SubclassOfCollection.fir.txt b/compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/SubclassOfCollection.fir.txt index 601eaa20f8b..f92c05708cd 100644 --- a/compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/SubclassOfCollection.fir.txt +++ b/compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/SubclassOfCollection.fir.txt @@ -1,4 +1,4 @@ -public abstract interface SubclassOfCollection : R|kotlin/collections/MutableCollection!>| { +public abstract interface SubclassOfCollection!|> : R|kotlin/collections/MutableCollection!>| { public abstract operator fun iterator(): R|kotlin/collections/MutableIterator!>| } diff --git a/compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/SubclassOfMapEntry.fir.txt b/compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/SubclassOfMapEntry.fir.txt index 35cbf8d6d8c..68511488c6f 100644 --- a/compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/SubclassOfMapEntry.fir.txt +++ b/compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/SubclassOfMapEntry.fir.txt @@ -1,4 +1,4 @@ -public abstract interface SubclassOfMapEntry : R|kotlin/collections/MutableMap.MutableEntry!, ft!>| { +public abstract interface SubclassOfMapEntry!|, V : R|ft!|> : R|kotlin/collections/MutableMap.MutableEntry!, ft!>| { public abstract operator fun setValue(value: R|ft!|): R|ft!| } diff --git a/compiler/testData/loadJava/compiledJava/library/LoadIterable.fir.txt b/compiler/testData/loadJava/compiledJava/library/LoadIterable.fir.txt index 0f2374604a4..9ddc69fb0f1 100644 --- a/compiler/testData/loadJava/compiledJava/library/LoadIterable.fir.txt +++ b/compiler/testData/loadJava/compiledJava/library/LoadIterable.fir.txt @@ -1,4 +1,4 @@ -public abstract interface LoadIterable : R|kotlin/Any| { +public abstract interface LoadIterable!|> : R|kotlin/Any| { public abstract fun getIterable(): R|ft!>, kotlin/collections/Iterable!>?>!| public abstract fun setIterable(Iterable: R|ft!>, kotlin/collections/Iterable!>?>!|): R|kotlin/Unit| diff --git a/compiler/testData/loadJava/compiledJava/library/LoadIterator.fir.txt b/compiler/testData/loadJava/compiledJava/library/LoadIterator.fir.txt index 4043aa54e79..ecfdd58c5f9 100644 --- a/compiler/testData/loadJava/compiledJava/library/LoadIterator.fir.txt +++ b/compiler/testData/loadJava/compiledJava/library/LoadIterator.fir.txt @@ -1,4 +1,4 @@ -public abstract interface LoadIterator : R|kotlin/Any| { +public abstract interface LoadIterator!|> : R|kotlin/Any| { public abstract fun getIterator(): R|ft!>, kotlin/collections/Iterator!>?>!| public abstract fun setIterator(iterator: R|ft!>, kotlin/collections/Iterator!>?>!|): R|kotlin/Unit| diff --git a/compiler/testData/loadJava/compiledJava/mutability/LoadIterable.fir.txt b/compiler/testData/loadJava/compiledJava/mutability/LoadIterable.fir.txt index 24f696b48a9..78a4930211e 100644 --- a/compiler/testData/loadJava/compiledJava/mutability/LoadIterable.fir.txt +++ b/compiler/testData/loadJava/compiledJava/mutability/LoadIterable.fir.txt @@ -1,4 +1,4 @@ -public abstract interface LoadIterable : R|kotlin/Any| { +public abstract interface LoadIterable!|> : R|kotlin/Any| { @R|kotlin/annotations/jvm/Mutable|() public abstract fun getIterable(): R|ft!>, kotlin/collections/MutableIterable!>?>!| public abstract fun setIterable(@R|kotlin/annotations/jvm/Mutable|() Iterable: R|ft!>, kotlin/collections/MutableIterable!>?>!|): R|kotlin/Unit| diff --git a/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithConflict.fir.txt b/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithConflict.fir.txt index fb4296785de..aff107cedea 100644 --- a/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithConflict.fir.txt +++ b/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithConflict.fir.txt @@ -1,4 +1,4 @@ -public abstract interface LoadIterableWithConflict : R|kotlin/Any| { +public abstract interface LoadIterableWithConflict!|> : R|kotlin/Any| { @R|kotlin/annotations/jvm/ReadOnly|() @R|kotlin/annotations/jvm/Mutable|() public abstract fun getIterable(): R|ft!>, kotlin/collections/Iterable!>?>!| public abstract fun setIterable(@R|kotlin/annotations/jvm/ReadOnly|() @R|kotlin/annotations/jvm/Mutable|() Iterable: R|ft!>, kotlin/collections/Iterable!>?>!|): R|kotlin/Unit| diff --git a/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithNullability.fir.txt b/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithNullability.fir.txt index 0b7e0241930..71b6103f0c8 100644 --- a/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithNullability.fir.txt +++ b/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithNullability.fir.txt @@ -1,4 +1,4 @@ -public abstract interface LoadIterableWithNullability : R|kotlin/Any| { +public abstract interface LoadIterableWithNullability!|> : R|kotlin/Any| { @R|org/jetbrains/annotations/NotNull|() @R|kotlin/annotations/jvm/Mutable|() public abstract fun getIterable(): R|kotlin/collections/MutableIterable!>| public abstract fun setIterable(@R|kotlin/annotations/jvm/Mutable|() @R|org/jetbrains/annotations/NotNull|() Iterable: R|kotlin/collections/MutableIterable!>|): R|kotlin/Unit| diff --git a/compiler/testData/loadJava/compiledJava/sam/Comparator.fir.txt b/compiler/testData/loadJava/compiledJava/sam/Comparator.fir.txt index ac9849146fa..fca15641778 100644 --- a/compiler/testData/loadJava/compiledJava/sam/Comparator.fir.txt +++ b/compiler/testData/loadJava/compiledJava/sam/Comparator.fir.txt @@ -1,4 +1,4 @@ -public abstract interface Comparator : R|kotlin/Any| { +public abstract interface Comparator!|> : R|kotlin/Any| { public abstract fun compare(o1: R|ft!|, o2: R|ft!|): R|kotlin/Int| public abstract operator fun equals(obj: R|kotlin/Any?|): R|kotlin/Boolean| diff --git a/compiler/testData/loadJava/compiledJava/sam/adapters/TypeParameterOfClass.fir.txt b/compiler/testData/loadJava/compiledJava/sam/adapters/TypeParameterOfClass.fir.txt index c4aab76e228..d640c1cbe35 100644 --- a/compiler/testData/loadJava/compiledJava/sam/adapters/TypeParameterOfClass.fir.txt +++ b/compiler/testData/loadJava/compiledJava/sam/adapters/TypeParameterOfClass.fir.txt @@ -1,6 +1,6 @@ -public open class TypeParameterOfClass : R|kotlin/Any| { +public open class TypeParameterOfClass!|> : R|kotlin/Any| { public open fun foo(comparator: R|ft!>, java/util/Comparator!>?>!|): R|kotlin/Unit| - public constructor(): R|test/TypeParameterOfClass| + public constructor!|>(): R|test/TypeParameterOfClass| } diff --git a/compiler/testData/loadJava/compiledJava/sam/adapters/TypeParameterOfMethod.fir.txt b/compiler/testData/loadJava/compiledJava/sam/adapters/TypeParameterOfMethod.fir.txt index ed699daf0f6..78e2598231a 100644 --- a/compiler/testData/loadJava/compiledJava/sam/adapters/TypeParameterOfMethod.fir.txt +++ b/compiler/testData/loadJava/compiledJava/sam/adapters/TypeParameterOfMethod.fir.txt @@ -1,5 +1,5 @@ public open class TypeParameterOfMethod : R|kotlin/Any| { - public open static fun max(comparator: R|ft!>, java/util/Comparator!>?>!|, value1: R|ft!|, value2: R|ft!|): R|ft!| + public open static fun !|> max(comparator: R|ft!>, java/util/Comparator!>?>!|, value1: R|ft!|, value2: R|ft!|): R|ft!| public open static fun !|> max2(comparator: R|ft!>, java/util/Comparator!>?>!|, value1: R|ft!|, value2: R|ft!|): R|ft!| diff --git a/compiler/testData/loadJava/compiledJava/sam/adapters/TypeParameterOfOuterClass.fir.txt b/compiler/testData/loadJava/compiledJava/sam/adapters/TypeParameterOfOuterClass.fir.txt index ced5f47264c..20bab8e6124 100644 --- a/compiler/testData/loadJava/compiledJava/sam/adapters/TypeParameterOfOuterClass.fir.txt +++ b/compiler/testData/loadJava/compiledJava/sam/adapters/TypeParameterOfOuterClass.fir.txt @@ -1,4 +1,4 @@ -public open class TypeParameterOfOuterClass : R|kotlin/Any| { - public constructor(): R|test/TypeParameterOfOuterClass| +public open class TypeParameterOfOuterClass!|> : R|kotlin/Any| { + public constructor!|>(): R|test/TypeParameterOfOuterClass| }