diff --git a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/types/ClassLiteralArgument.txt b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/types/ClassLiteralArgument.txt index a4887b79335..9b5c7238180 100644 --- a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/types/ClassLiteralArgument.txt +++ b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/types/ClassLiteralArgument.txt @@ -1,11 +1,11 @@ public final class A : R|kotlin/Any| { - public final fun arrays(s: @R|test/Ann|(klass = ((R|kotlin/Int|))) R|kotlin/Array|, t: @R|test/Ann|(klass = ((R|kotlin/IntArray|))) R|kotlin/Array|, u: @R|test/Ann|(klass = ((R|kotlin/Int|))) R|kotlin/Array>|, v: @R|test/Ann|(klass = ((R|kotlin/String|))) R|kotlin/Array>>|): R|kotlin/Unit| + public final fun arrays(s: R|@R|test/Ann|(klass = ((R|kotlin/Int|))) kotlin/Array|, t: R|@R|test/Ann|(klass = ((R|kotlin/IntArray|))) kotlin/Array|, u: R|@R|test/Ann|(klass = ((R|kotlin/Int|))) kotlin/Array>|, v: R|@R|test/Ann|(klass = ((R|kotlin/String|))) kotlin/Array>>|): R|kotlin/Unit| - public final fun generic(s: @R|test/Ann|(klass = ((R|test/Generic|))) R|kotlin/String|): R|kotlin/Unit| + public final fun generic(s: R|@R|test/Ann|(klass = ((R|test/Generic|))) kotlin/String|): R|kotlin/Unit| - public final fun innerGeneric(s: @R|test/Ann|(klass = ((R|test/InnerGeneric.Inner|))) R|kotlin/String|): R|kotlin/Unit| + public final fun innerGeneric(s: R|@R|test/Ann|(klass = ((R|test/InnerGeneric.Inner|))) kotlin/String|): R|kotlin/Unit| - public final fun simple(s: @R|test/Ann|(klass = ((R|test/Simple|))) R|kotlin/String|): R|kotlin/Unit| + public final fun simple(s: R|@R|test/Ann|(klass = ((R|test/Simple|))) kotlin/String|): R|kotlin/Unit| public constructor(): R|test/A| diff --git a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/types/ReceiverParameter.txt b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/types/ReceiverParameter.txt index 1e558b421dc..d5616371745 100644 --- a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/types/ReceiverParameter.txt +++ b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/types/ReceiverParameter.txt @@ -1,4 +1,4 @@ -public final fun @R|test/A|() R|kotlin/String|.foo(): R|kotlin/Unit| +public final fun R|@R|test/A|() kotlin/String|.foo(): R|kotlin/Unit| @R|kotlin/annotation/Target|(allowedTargets = (R|kotlin/annotation/AnnotationTarget.TYPE|())) public final annotation class A : R|kotlin/Annotation| { public constructor(): R|test/A| diff --git a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/types/SimpleTypeAnnotation.txt b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/types/SimpleTypeAnnotation.txt index 3631a7836d9..cdf75a4cc4d 100644 --- a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/types/SimpleTypeAnnotation.txt +++ b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/types/SimpleTypeAnnotation.txt @@ -4,7 +4,7 @@ } public final class SimpleTypeAnnotation : R|kotlin/Any| { - public final fun foo(x: @R|test/A|() R|kotlin/ranges/IntRange|): @R|test/A|() R|kotlin/Int| + public final fun foo(x: R|@R|test/A|() kotlin/ranges/IntRange|): R|@R|test/A|() kotlin/Int| public constructor(): R|test/SimpleTypeAnnotation| diff --git a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/types/SupertypesAndBounds.txt b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/types/SupertypesAndBounds.txt index 0136c254369..4e474faee1a 100644 --- a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/types/SupertypesAndBounds.txt +++ b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/types/SupertypesAndBounds.txt @@ -3,7 +3,7 @@ } -public abstract interface Foo : R|java/io/Serializable| { +public abstract interface Foo : R|java/io/Serializable| { public abstract fun bar(): R|kotlin/Unit| } diff --git a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/types/TypeAnnotationWithArguments.txt b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/types/TypeAnnotationWithArguments.txt index d6858f5175b..56bf7924009 100644 --- a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/types/TypeAnnotationWithArguments.txt +++ b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/types/TypeAnnotationWithArguments.txt @@ -10,7 +10,7 @@ } public final class TypeAnnotationWithArguments : R|kotlin/Any| { - public final fun foo(param: @R|test/Ann|(x = String(param), y = Double(3.14)) R|kotlin/ranges/IntRange|): @R|test/Ann|(x = String(fun), y = Double(2.72)) R|kotlin/Unit| + public final fun foo(param: R|@R|test/Ann|(x = String(param), y = Double(3.14)) kotlin/ranges/IntRange|): R|@R|test/Ann|(x = String(fun), y = Double(2.72)) kotlin/Unit| public constructor(): R|test/TypeAnnotationWithArguments| diff --git a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/types/TypeArgument.txt b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/types/TypeArgument.txt index 5806ba046f5..254369b2faa 100644 --- a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/types/TypeArgument.txt +++ b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/types/TypeArgument.txt @@ -1,4 +1,4 @@ -public final fun foo(bar: R|kotlin/collections/Map>|): R|kotlin/Unit| +public final fun foo(bar: R|kotlin/collections/Map<@R|test/A|() kotlin/String, kotlin/collections/List<@R|test/A|() kotlin/Int>>|): R|kotlin/Unit| @R|kotlin/annotation/Target|(allowedTargets = (R|kotlin/annotation/AnnotationTarget.TYPE|())) public final annotation class A : R|kotlin/Annotation| { public constructor(): R|test/A| diff --git a/compiler/fir/analysis-tests/testData/resolve/arguments/varargOfLambdasWithReceiver.fir.txt b/compiler/fir/analysis-tests/testData/resolve/arguments/varargOfLambdasWithReceiver.fir.txt index ceedfa89619..80967352756 100644 --- a/compiler/fir/analysis-tests/testData/resolve/arguments/varargOfLambdasWithReceiver.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/arguments/varargOfLambdasWithReceiver.fir.txt @@ -1,5 +1,5 @@ FILE: varargOfLambdasWithReceiver.kt - public final fun runLambdas(vararg values: @R|kotlin/ExtensionFunctionType|() R|kotlin/Array>|): R|kotlin/Unit| { + public final fun runLambdas(vararg values: R|kotlin/Array>|): R|kotlin/Unit| { } public final fun test(): R|kotlin/Unit| { R|/runLambdas|(vararg(runLambdas@fun R|kotlin/String|.(): R|kotlin/Unit| { diff --git a/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantExplicitTypeChecker.fir.txt b/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantExplicitTypeChecker.fir.txt index c31e3cce72d..69fb3c9d3f0 100644 --- a/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantExplicitTypeChecker.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantExplicitTypeChecker.fir.txt @@ -6,7 +6,7 @@ FILE: RedundantExplicitTypeChecker.kt } public final fun annotated(): R|kotlin/Unit| { - lval x: @R|A|() R|kotlin/Int| = Int(1) + lval x: R|@R|A|() kotlin/Int| = Int(1) } public final object SomeObj : R|kotlin/Any| { private constructor(): R|SomeObj| { diff --git a/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantReturnUnitTypeChecker.fir.txt b/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantReturnUnitTypeChecker.fir.txt index 6e2bc788e52..d25ec967144 100644 --- a/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantReturnUnitTypeChecker.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantReturnUnitTypeChecker.fir.txt @@ -22,7 +22,7 @@ FILE: RedundantReturnUnitTypeChecker.kt super() } - public final fun too(): @R|kotlin/Annotation|() R|@R|kotlin/Annotation|() kotlin/Unit| { + public final fun too(): R|@R|kotlin/Annotation|() kotlin/Unit| { } public final fun foo(): R|kotlin/Unit| { diff --git a/compiler/fir/analysis-tests/testData/resolve/inference/nestedExtensionFunctionType.fir.txt b/compiler/fir/analysis-tests/testData/resolve/inference/nestedExtensionFunctionType.fir.txt index 0cbe9aaa162..27edc0f1ff3 100644 --- a/compiler/fir/analysis-tests/testData/resolve/inference/nestedExtensionFunctionType.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/inference/nestedExtensionFunctionType.fir.txt @@ -15,7 +15,7 @@ FILE: nestedExtensionFunctionType.kt } } - public final fun test_2(a: R|A|, vararg zs: @R|kotlin/ExtensionFunctionType|() R|kotlin/Array>|): R|kotlin/Unit| { + public final fun test_2(a: R|A|, vararg zs: R|kotlin/Array>|): R|kotlin/Unit| { { lval : R|kotlin/collections/Iterator<@ExtensionFunctionType kotlin/Function1>| = R|/zs|.R|SubstitutionOverride)>|>|() while(R|/|.R|kotlin/collections/Iterator.hasNext|()) { diff --git a/compiler/fir/analysis-tests/testData/resolve/multifile/Annotations.fir.txt b/compiler/fir/analysis-tests/testData/resolve/multifile/Annotations.fir.txt index 165e50955bc..c7eccbef40c 100644 --- a/compiler/fir/analysis-tests/testData/resolve/multifile/Annotations.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/multifile/Annotations.fir.txt @@ -63,15 +63,15 @@ FILE: main.kt super() } - @R|annotations/Simple|() public abstract fun foo(@R|annotations/WithString|(String(abc)) arg: @R|annotations/Simple|() R|kotlin/Double|): R|kotlin/Unit| + @R|annotations/Simple|() public abstract fun foo(@R|annotations/WithString|(String(abc)) arg: R|@R|annotations/Simple|() kotlin/Double|): R|kotlin/Unit| @R|annotations/Complex|(R|annotations/WithInt.WithInt|(Int(7)), R|annotations/WithString.WithString|(String())) public abstract val v: R|kotlin/String| public get(): R|kotlin/String| } - @R|annotations/WithString|(String(xyz)) public final class Second : @R|annotations/WithInt|(Int(0)) R|test/First| { + @R|annotations/WithString|(String(xyz)) public final class Second : R|@R|annotations/WithInt|(Int(0)) test/First| { public constructor(y: R|kotlin/Char|): R|test/Second| { - super<@R|annotations/WithInt|(Int(0)) R|test/First|>() + super() } public final val y: R|kotlin/Char| = R|/y| @@ -90,4 +90,4 @@ FILE: main.kt } } - @R|annotations/WithInt|(Int(24)) @R|annotations/VeryComplex|(Float(3.14), Double(6.67E-11), Boolean(false), Long(123456789012345), Null(null)) @R|annotations/WithInt|(Int(24)) @R|annotations/VeryComplex|(Float(3.14), Double(6.67E-11), Boolean(false), Long(123456789012345), Null(null)) public final typealias Third = @R|annotations/Simple|() R|test/Second| + @R|annotations/WithInt|(Int(24)) @R|annotations/VeryComplex|(Float(3.14), Double(6.67E-11), Boolean(false), Long(123456789012345), Null(null)) @R|annotations/WithInt|(Int(24)) @R|annotations/VeryComplex|(Float(3.14), Double(6.67E-11), Boolean(false), Long(123456789012345), Null(null)) public final typealias Third = R|@R|annotations/Simple|() test/Second| diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/FirRenderer.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/FirRenderer.kt index a0d42cf1d11..2b4eadcef93 100644 --- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/FirRenderer.kt +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/FirRenderer.kt @@ -1001,12 +1001,6 @@ class FirRenderer(builder: StringBuilder, private val mode: RenderMode = RenderM override fun visitResolvedTypeRef(resolvedTypeRef: FirResolvedTypeRef) { val kind = resolvedTypeRef.functionTypeKind - val annotations = if (kind.withPrettyRender()) { - resolvedTypeRef.annotations.dropExtensionFunctionAnnotation() - } else { - resolvedTypeRef.annotations - } - annotations.renderAnnotations() print("R|") val coneType = resolvedTypeRef.type print(coneType.renderFunctionType(kind, resolvedTypeRef.annotations.any { diff --git a/compiler/testData/loadJava/compiledJava/annotations/AnnotatedTypeInFun.fir.txt b/compiler/testData/loadJava/compiledJava/annotations/AnnotatedTypeInFun.fir.txt index a1728edc17b..75505dbbc3a 100644 --- a/compiler/testData/loadJava/compiledJava/annotations/AnnotatedTypeInFun.fir.txt +++ b/compiler/testData/loadJava/compiledJava/annotations/AnnotatedTypeInFun.fir.txt @@ -1,5 +1,5 @@ public/*package*/ open class AnnotatedTypeInFun : R|kotlin/Any| { - public/*package*/ open fun foo(@R|test/AnnotatedTypeInFun.Anno|(String(a)) a: @R|test/AnnotatedTypeInFun.Anno|(String(a)) R|ft|, @R|test/AnnotatedTypeInFun.Anno|(String(b)) b: @R|test/AnnotatedTypeInFun.Anno|(String(b)) R|ft|): R|kotlin/Unit| + public/*package*/ open fun foo(@R|test/AnnotatedTypeInFun.Anno|(String(a)) a: R|ft|, @R|test/AnnotatedTypeInFun.Anno|(String(b)) b: R|ft|): R|kotlin/Unit| public/*package*/ constructor(): R|test/AnnotatedTypeInFun| diff --git a/compiler/testData/loadJava/compiledJava/modality/ModalityOfFakeOverrides.fir.txt b/compiler/testData/loadJava/compiledJava/modality/ModalityOfFakeOverrides.fir.txt index a5cf9efd5d1..8aa4301a07e 100644 --- a/compiler/testData/loadJava/compiledJava/modality/ModalityOfFakeOverrides.fir.txt +++ b/compiler/testData/loadJava/compiledJava/modality/ModalityOfFakeOverrides.fir.txt @@ -1,5 +1,5 @@ public open class ModalityOfFakeOverrides : R|java/util/AbstractList>| { - @R|java/lang/Override|() @R|org/jetbrains/annotations/NotNull|() public open operator fun get(index: R|kotlin/Int|): R|@EnhancedNullability kotlin/String| + @R|java/lang/Override|() @R|org/jetbrains/annotations/NotNull|() public open operator fun get(index: R|kotlin/Int|): R|@EnhancedNullability @R|java/lang/Override|() kotlin/String| public constructor(): R|test/ModalityOfFakeOverrides| diff --git a/idea/idea-frontend-fir/testData/symbols/symbolByPsi/typeAnnotations.kt b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/typeAnnotations.kt index f58e034b793..2d95c35bc92 100644 --- a/idea/idea-frontend-fir/testData/symbols/symbolByPsi/typeAnnotations.kt +++ b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/typeAnnotations.kt @@ -112,7 +112,7 @@ KtFirNamedClassOrObjectSymbol: visibility: Public KtFirValueParameterSymbol: - annotatedType: [Anno2()] I + annotatedType: [Anno2()] @R|Anno2|() I annotationClassIds: [] annotations: [] callableIdIfNonLocal: null @@ -125,7 +125,7 @@ KtFirValueParameterSymbol: symbolKind: LOCAL KtFirFunctionSymbol: - annotatedType: [Anno3()] I + annotatedType: [Anno3()] @R|Anno3|() I annotationClassIds: [] annotations: [] callableIdIfNonLocal: /X.f @@ -146,7 +146,7 @@ KtFirFunctionSymbol: visibility: Public KtFirKotlinPropertySymbol: - annotatedType: [Anno4()] I + annotatedType: [Anno4()] @R|Anno4|() I annotationClassIds: [] annotations: [] callableIdIfNonLocal: /X.x @@ -183,7 +183,7 @@ KtFirNamedClassOrObjectSymbol: modality: FINAL name: X origin: SOURCE - superTypes: [[Anno1()] I] + superTypes: [[Anno1()] @R|Anno1|() I] symbolKind: TOP_LEVEL typeParameters: [] visibility: Public