From 4e1dfcd2a8ffc167ced036717cf5a52fce3b8511 Mon Sep 17 00:00:00 2001 From: Kirill Rakhman Date: Tue, 12 Sep 2023 14:27:29 +0200 Subject: [PATCH] [FIR] Improve readability of rendered types in diagnostics #KT-61824 Fixed #KT-61688 Fixed --- .../api/fir/symbols/pointers/FirCallableSignature.kt | 4 ++-- .../expresssions/invoke/threeReceiversCorrect.kt | 2 +- .../kotlin/fir/renderer/ConeAttributeRenderer.kt | 12 +++++++++--- .../kotlin/fir/renderer/ConeTypeRenderer.kt | 11 ++++++----- .../fir/renderer/ConeTypeRendererForReadability.kt | 8 ++++++-- .../org/jetbrains/kotlin/fir/types/ConeAttributes.kt | 1 + .../org/jetbrains/kotlin/fir/renderer/FirRenderer.kt | 12 ++++++++++++ .../fir/types/CustomAnnotationTypeAttribute.kt | 4 ++++ compiler/testData/cli/jvm/compatqualDefault.out | 2 +- compiler/testData/cli/jvm/compatqualEnable.out | 2 +- compiler/testData/cli/jvm/jspecifyDefault.out | 2 +- compiler/testData/cli/jvm/jspecifyStrict.out | 2 +- compiler/testData/cli/jvm/jsr305DefaultMigration.out | 2 +- compiler/testData/cli/jvm/jsr305DeprecatedEnable.out | 2 +- compiler/testData/cli/jvm/jsr305FqNameIgnore.out | 2 +- compiler/testData/cli/jvm/jsr305FqNameStrict.out | 4 ++-- compiler/testData/cli/jvm/jsr305MigrationDefault.out | 2 +- compiler/testData/cli/jvm/jsr305Strict.out | 2 +- compiler/testData/cli/jvm/nullabilityAnnotations.out | 2 +- .../annotations/annotationRenderingInTypes.fir.kt | 6 +++--- .../annotations/rendering/memberProjectedOut.fir.kt | 2 +- .../typeMismatchDueToTypeProjections.fir.kt | 2 +- .../rendering/typeMismatchOnOverride.fir.kt | 2 +- ...tionWithReceiverToUnitImplicitLiteralsCase.fir.kt | 4 ++-- ...eParameterWithKotlinNullableWarnings.fir.diag.txt | 8 ++++---- 25 files changed, 65 insertions(+), 37 deletions(-) diff --git a/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/symbols/pointers/FirCallableSignature.kt b/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/symbols/pointers/FirCallableSignature.kt index da0e4338ac5..03d772700d6 100644 --- a/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/symbols/pointers/FirCallableSignature.kt +++ b/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/symbols/pointers/FirCallableSignature.kt @@ -14,7 +14,7 @@ import org.jetbrains.kotlin.fir.renderer.ConeTypeRenderer import org.jetbrains.kotlin.fir.renderer.FirRenderer import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol import org.jetbrains.kotlin.fir.symbols.lazyResolveToPhase -import org.jetbrains.kotlin.fir.types.ConeAttributes +import org.jetbrains.kotlin.fir.types.ConeAttribute import org.jetbrains.kotlin.fir.types.FirTypeRef /** @@ -114,5 +114,5 @@ private fun FirTypeRef.renderType(builder: StringBuilder = StringBuilder()): Str ).renderElementAsString(this) private object EmptyConeTypeAttributeRenderer : ConeAttributeRenderer() { - override fun render(attributes: ConeAttributes): String = "" + override fun render(attributes: Iterable>): String = "" } diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/threeReceiversCorrect.kt b/compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/threeReceiversCorrect.kt index 88dc6927cac..ad2cc3aa1ae 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/threeReceiversCorrect.kt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/threeReceiversCorrect.kt @@ -3,7 +3,7 @@ class C class B class A { - val B.foo: C.() -> Unit get() = ")!>null + val B.foo: C.() -> Unit get() = ")!>null } fun with(arg: T, f: T.() -> R): R = arg.f() diff --git a/compiler/fir/cones/src/org/jetbrains/kotlin/fir/renderer/ConeAttributeRenderer.kt b/compiler/fir/cones/src/org/jetbrains/kotlin/fir/renderer/ConeAttributeRenderer.kt index 8669f21daf1..13202d1cf6c 100644 --- a/compiler/fir/cones/src/org/jetbrains/kotlin/fir/renderer/ConeAttributeRenderer.kt +++ b/compiler/fir/cones/src/org/jetbrains/kotlin/fir/renderer/ConeAttributeRenderer.kt @@ -5,12 +5,18 @@ package org.jetbrains.kotlin.fir.renderer -import org.jetbrains.kotlin.fir.types.ConeAttributes +import org.jetbrains.kotlin.fir.types.ConeAttribute abstract class ConeAttributeRenderer { - abstract fun render(attributes: ConeAttributes): String + abstract fun render(attributes: Iterable>): String object ToString : ConeAttributeRenderer() { - override fun render(attributes: ConeAttributes): String = attributes.joinToString(separator = " ", postfix = " ") { it.toString() } + override fun render(attributes: Iterable>): String = + attributes.joinToString(separator = " ", postfix = " ") { it.toString() } + } + + object ForReadability : ConeAttributeRenderer() { + override fun render(attributes: Iterable>): String = + attributes.joinToString(separator = " ", postfix = " ") { it.renderForReadability() } } } diff --git a/compiler/fir/cones/src/org/jetbrains/kotlin/fir/renderer/ConeTypeRenderer.kt b/compiler/fir/cones/src/org/jetbrains/kotlin/fir/renderer/ConeTypeRenderer.kt index 97c2300d086..1a71d324df4 100644 --- a/compiler/fir/cones/src/org/jetbrains/kotlin/fir/renderer/ConeTypeRenderer.kt +++ b/compiler/fir/cones/src/org/jetbrains/kotlin/fir/renderer/ConeTypeRenderer.kt @@ -7,6 +7,7 @@ package org.jetbrains.kotlin.fir.renderer import org.jetbrains.kotlin.builtins.functions.FunctionTypeKind import org.jetbrains.kotlin.fir.types.* +import org.jetbrains.kotlin.utils.addToStdlib.ifNotEmpty open class ConeTypeRenderer( private val attributeRenderer: ConeAttributeRenderer = ConeAttributeRenderer.ToString @@ -180,16 +181,16 @@ open class ConeTypeRenderer( builder.append(">") } - private fun ConeKotlinType.renderAttributes() { + protected open fun ConeKotlinType.renderAttributes() { if (!attributes.any()) return builder.append(attributeRenderer.render(attributes)) } - private fun ConeKotlinType.renderNonCompilerAttributes() { + protected fun ConeKotlinType.renderNonCompilerAttributes() { val compilerAttributes = CompilerConeAttributes.classIdByCompilerAttributeKey - if (attributes.any { it.key !in compilerAttributes }) { - builder.append(attributeRenderer.render(attributes)) - } + attributes + .filter { it.key !in compilerAttributes } + .ifNotEmpty { builder.append(attributeRenderer.render(this)) } } private fun ConeTypeProjection.render() { diff --git a/compiler/fir/cones/src/org/jetbrains/kotlin/fir/renderer/ConeTypeRendererForReadability.kt b/compiler/fir/cones/src/org/jetbrains/kotlin/fir/renderer/ConeTypeRendererForReadability.kt index 3189cfd3a99..1b80121e6cc 100644 --- a/compiler/fir/cones/src/org/jetbrains/kotlin/fir/renderer/ConeTypeRendererForReadability.kt +++ b/compiler/fir/cones/src/org/jetbrains/kotlin/fir/renderer/ConeTypeRendererForReadability.kt @@ -8,13 +8,13 @@ package org.jetbrains.kotlin.fir.renderer import org.jetbrains.kotlin.builtins.StandardNames import org.jetbrains.kotlin.fir.types.ConeFlexibleType import org.jetbrains.kotlin.fir.types.ConeIntegerLiteralType +import org.jetbrains.kotlin.fir.types.ConeKotlinType import org.jetbrains.kotlin.renderer.replacePrefixesInTypeRepresentations import org.jetbrains.kotlin.renderer.typeStringsDifferOnlyInNullability class ConeTypeRendererForReadability( private val idRendererCreator: () -> ConeIdRenderer, -) : ConeTypeRenderer() { - +) : ConeTypeRenderer(ConeAttributeRenderer.ForReadability) { constructor(builder: StringBuilder, idRendererCreator: () -> ConeIdRenderer) : this(idRendererCreator) { this.builder = builder this.idRenderer = idRendererCreator() @@ -76,4 +76,8 @@ class ConeTypeRendererForReadability( override fun render(type: ConeIntegerLiteralType) { render(type.getApproximatedType()) } + + override fun ConeKotlinType.renderAttributes() { + renderNonCompilerAttributes() + } } diff --git a/compiler/fir/cones/src/org/jetbrains/kotlin/fir/types/ConeAttributes.kt b/compiler/fir/cones/src/org/jetbrains/kotlin/fir/types/ConeAttributes.kt index a391a6a343e..db3fdf52eb0 100644 --- a/compiler/fir/cones/src/org/jetbrains/kotlin/fir/types/ConeAttributes.kt +++ b/compiler/fir/cones/src/org/jetbrains/kotlin/fir/types/ConeAttributes.kt @@ -30,6 +30,7 @@ abstract class ConeAttribute> : AnnotationMarker { abstract fun isSubtypeOf(other: @UnsafeVariance T?): Boolean abstract override fun toString(): String + open fun renderForReadability(): String = toString() abstract val key: KClass } diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/renderer/FirRenderer.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/renderer/FirRenderer.kt index 2a98f1948be..ce0cc554864 100644 --- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/renderer/FirRenderer.kt +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/renderer/FirRenderer.kt @@ -66,6 +66,18 @@ class FirRenderer( fun withDeclarationAttributes(): FirRenderer = FirRenderer(declarationRenderer = FirDeclarationRendererWithAttributes()) + + fun forReadability(): FirRenderer = FirRenderer( + typeRenderer = ConeTypeRenderer(), + idRenderer = ConeIdShortRenderer(), + classMemberRenderer = FirNoClassMemberRenderer(), + bodyRenderer = null, + propertyAccessorRenderer = null, + callArgumentsRenderer = FirCallNoArgumentsRenderer(), + modifierRenderer = FirPartialModifierRenderer(), + valueParameterRenderer = FirValueParameterRendererNoDefaultValue(), + declarationRenderer = FirDeclarationRenderer("local ") + ) } init { diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/CustomAnnotationTypeAttribute.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/CustomAnnotationTypeAttribute.kt index d81dd59db68..7c608c7c8ff 100644 --- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/CustomAnnotationTypeAttribute.kt +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/CustomAnnotationTypeAttribute.kt @@ -10,6 +10,7 @@ import org.jetbrains.kotlin.fir.expressions.FirAnnotationCall import org.jetbrains.kotlin.fir.expressions.builder.buildAnnotationCallCopy import org.jetbrains.kotlin.fir.expressions.builder.buildAnnotationCopy import org.jetbrains.kotlin.fir.render +import org.jetbrains.kotlin.fir.renderer.FirRenderer import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol import kotlin.reflect.KClass @@ -55,6 +56,9 @@ class CustomAnnotationTypeAttribute( override fun toString(): String = annotations.joinToString(separator = " ") { it.render() } + override fun renderForReadability(): String = + annotations.joinToString(separator = " ") { FirRenderer.forReadability().renderElementAsString(it, trim = true) } + override val key: KClass get() = CustomAnnotationTypeAttribute::class diff --git a/compiler/testData/cli/jvm/compatqualDefault.out b/compiler/testData/cli/jvm/compatqualDefault.out index a4944f42a19..fd67c4d6118 100644 --- a/compiler/testData/cli/jvm/compatqualDefault.out +++ b/compiler/testData/cli/jvm/compatqualDefault.out @@ -1,4 +1,4 @@ -compiler/testData/cli/jvm/compatqualUsage.kt:2:11: error: null cannot be a value of a non-null type '@EnhancedNullability kotlin/String'. +compiler/testData/cli/jvm/compatqualUsage.kt:2:11: error: null cannot be a value of a non-null type 'kotlin/String'. b.foo(null) ^ COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/compatqualEnable.out b/compiler/testData/cli/jvm/compatqualEnable.out index a4944f42a19..fd67c4d6118 100644 --- a/compiler/testData/cli/jvm/compatqualEnable.out +++ b/compiler/testData/cli/jvm/compatqualEnable.out @@ -1,4 +1,4 @@ -compiler/testData/cli/jvm/compatqualUsage.kt:2:11: error: null cannot be a value of a non-null type '@EnhancedNullability kotlin/String'. +compiler/testData/cli/jvm/compatqualUsage.kt:2:11: error: null cannot be a value of a non-null type 'kotlin/String'. b.foo(null) ^ COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/jspecifyDefault.out b/compiler/testData/cli/jvm/jspecifyDefault.out index e7dd0b92044..48e9615b774 100644 --- a/compiler/testData/cli/jvm/jspecifyDefault.out +++ b/compiler/testData/cli/jvm/jspecifyDefault.out @@ -1,4 +1,4 @@ -compiler/testData/cli/jvm/jspecifyUsage.kt:2:11: error: null cannot be a value of a non-null type '@EnhancedNullability kotlin/String'. +compiler/testData/cli/jvm/jspecifyUsage.kt:2:11: error: null cannot be a value of a non-null type 'kotlin/String'. a.foo(null) ^ COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/jspecifyStrict.out b/compiler/testData/cli/jvm/jspecifyStrict.out index e7dd0b92044..48e9615b774 100644 --- a/compiler/testData/cli/jvm/jspecifyStrict.out +++ b/compiler/testData/cli/jvm/jspecifyStrict.out @@ -1,4 +1,4 @@ -compiler/testData/cli/jvm/jspecifyUsage.kt:2:11: error: null cannot be a value of a non-null type '@EnhancedNullability kotlin/String'. +compiler/testData/cli/jvm/jspecifyUsage.kt:2:11: error: null cannot be a value of a non-null type 'kotlin/String'. a.foo(null) ^ COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/jsr305DefaultMigration.out b/compiler/testData/cli/jvm/jsr305DefaultMigration.out index 5a66a87b6aa..8ce1f96bd9d 100644 --- a/compiler/testData/cli/jvm/jsr305DefaultMigration.out +++ b/compiler/testData/cli/jvm/jsr305DefaultMigration.out @@ -1,4 +1,4 @@ -compiler/testData/cli/jvm/jsr305DefaultMigration.kt:2:19: error: null cannot be a value of a non-null type '@EnhancedNullability kotlin/String'. +compiler/testData/cli/jvm/jsr305DefaultMigration.kt:2:19: error: null cannot be a value of a non-null type 'kotlin/String'. annotated.foo(null) ^ COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/jsr305DeprecatedEnable.out b/compiler/testData/cli/jvm/jsr305DeprecatedEnable.out index e159cb11426..4e02f7bbc62 100644 --- a/compiler/testData/cli/jvm/jsr305DeprecatedEnable.out +++ b/compiler/testData/cli/jvm/jsr305DeprecatedEnable.out @@ -1,6 +1,6 @@ warning: argument -Xjsr305-annotations is deprecated. Please use -Xjsr305 instead warning: option 'enable' for -Xjsr305 flag is deprecated. Please use 'strict' instead -compiler/testData/cli/jvm/jsr305Usage.kt:2:11: error: null cannot be a value of a non-null type '@EnhancedNullability kotlin/String'. +compiler/testData/cli/jvm/jsr305Usage.kt:2:11: error: null cannot be a value of a non-null type 'kotlin/String'. a.foo(null) ^ COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/jsr305FqNameIgnore.out b/compiler/testData/cli/jvm/jsr305FqNameIgnore.out index 32a79f84a7e..249b5f5931f 100644 --- a/compiler/testData/cli/jvm/jsr305FqNameIgnore.out +++ b/compiler/testData/cli/jvm/jsr305FqNameIgnore.out @@ -1,4 +1,4 @@ -compiler/testData/cli/jvm/jsr305Migration.kt:3:19: error: null cannot be a value of a non-null type '@EnhancedNullability kotlin/String'. +compiler/testData/cli/jvm/jsr305Migration.kt:3:19: error: null cannot be a value of a non-null type 'kotlin/String'. annotated.bar(null) ^ COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/jsr305FqNameStrict.out b/compiler/testData/cli/jvm/jsr305FqNameStrict.out index c6af36a74db..9acb2503beb 100644 --- a/compiler/testData/cli/jvm/jsr305FqNameStrict.out +++ b/compiler/testData/cli/jvm/jsr305FqNameStrict.out @@ -1,7 +1,7 @@ -compiler/testData/cli/jvm/jsr305Migration.kt:2:19: error: null cannot be a value of a non-null type '@EnhancedNullability kotlin/String'. +compiler/testData/cli/jvm/jsr305Migration.kt:2:19: error: null cannot be a value of a non-null type 'kotlin/String'. annotated.foo(null) ^ -compiler/testData/cli/jvm/jsr305Migration.kt:3:19: error: null cannot be a value of a non-null type '@EnhancedNullability kotlin/String'. +compiler/testData/cli/jvm/jsr305Migration.kt:3:19: error: null cannot be a value of a non-null type 'kotlin/String'. annotated.bar(null) ^ COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/jsr305MigrationDefault.out b/compiler/testData/cli/jvm/jsr305MigrationDefault.out index 32a79f84a7e..249b5f5931f 100644 --- a/compiler/testData/cli/jvm/jsr305MigrationDefault.out +++ b/compiler/testData/cli/jvm/jsr305MigrationDefault.out @@ -1,4 +1,4 @@ -compiler/testData/cli/jvm/jsr305Migration.kt:3:19: error: null cannot be a value of a non-null type '@EnhancedNullability kotlin/String'. +compiler/testData/cli/jvm/jsr305Migration.kt:3:19: error: null cannot be a value of a non-null type 'kotlin/String'. annotated.bar(null) ^ COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/jsr305Strict.out b/compiler/testData/cli/jvm/jsr305Strict.out index 82b600502de..c23ead19d1c 100644 --- a/compiler/testData/cli/jvm/jsr305Strict.out +++ b/compiler/testData/cli/jvm/jsr305Strict.out @@ -1,4 +1,4 @@ -compiler/testData/cli/jvm/jsr305Usage.kt:2:11: error: null cannot be a value of a non-null type '@EnhancedNullability kotlin/String'. +compiler/testData/cli/jvm/jsr305Usage.kt:2:11: error: null cannot be a value of a non-null type 'kotlin/String'. a.foo(null) ^ COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/nullabilityAnnotations.out b/compiler/testData/cli/jvm/nullabilityAnnotations.out index bfcbeb0a4d9..875ef3e7a0e 100644 --- a/compiler/testData/cli/jvm/nullabilityAnnotations.out +++ b/compiler/testData/cli/jvm/nullabilityAnnotations.out @@ -1,4 +1,4 @@ -compiler/testData/cli/jvm/severalAnnotations.kt:2:11: error: null cannot be a value of a non-null type '@EnhancedNullability kotlin/String'. +compiler/testData/cli/jvm/severalAnnotations.kt:2:11: error: null cannot be a value of a non-null type 'kotlin/String'. a.foo(null) ^ COMPILATION_ERROR diff --git a/compiler/testData/diagnostics/tests/annotations/annotationRenderingInTypes.fir.kt b/compiler/testData/diagnostics/tests/annotations/annotationRenderingInTypes.fir.kt index de88d1d6699..fa6c8284ffc 100644 --- a/compiler/testData/diagnostics/tests/annotations/annotationRenderingInTypes.fir.kt +++ b/compiler/testData/diagnostics/tests/annotations/annotationRenderingInTypes.fir.kt @@ -12,14 +12,14 @@ annotation class Ann fun <@Ann R : @Ann Any> f3(a: Array<@Ann R>): Array<@Ann R?> = null!! fun test2(a: @Ann Array) { - val r: Array = f3(; @R|Ann|() kotlin/Array")!>a) + val r: Array = f3(; @Ann() kotlin/Array")!>a) } var test3: Int = 0 - set(s: @Ann String) {} + set(s: @Ann String) {} fun f4(fn: (@Ann Int, @Ann Int) -> Unit) {} -val test4 = f4 ; kotlin/Function1<@R|Ann|() kotlin/Int, kotlin/Unit>")!>{ single -> } +val test4 = f4 ; kotlin/Function1<@Ann() kotlin/Int, kotlin/Unit>")!>{ single -> } diff --git a/compiler/testData/diagnostics/tests/annotations/rendering/memberProjectedOut.fir.kt b/compiler/testData/diagnostics/tests/annotations/rendering/memberProjectedOut.fir.kt index 81579e7c57e..86c52246b29 100644 --- a/compiler/testData/diagnostics/tests/annotations/rendering/memberProjectedOut.fir.kt +++ b/compiler/testData/diagnostics/tests/annotations/rendering/memberProjectedOut.fir.kt @@ -11,5 +11,5 @@ class C { } fun test(a: C) { - a[1] = 25 + a[1] = 25 } diff --git a/compiler/testData/diagnostics/tests/annotations/rendering/typeMismatchDueToTypeProjections.fir.kt b/compiler/testData/diagnostics/tests/annotations/rendering/typeMismatchDueToTypeProjections.fir.kt index 20778ae8362..eae1841cb4b 100644 --- a/compiler/testData/diagnostics/tests/annotations/rendering/typeMismatchDueToTypeProjections.fir.kt +++ b/compiler/testData/diagnostics/tests/annotations/rendering/typeMismatchDueToTypeProjections.fir.kt @@ -13,5 +13,5 @@ class C { class Out fun test(a: C, y: Out) { - a + ; Out")!>y + a + ; Out")!>y } diff --git a/compiler/testData/diagnostics/tests/annotations/rendering/typeMismatchOnOverride.fir.kt b/compiler/testData/diagnostics/tests/annotations/rendering/typeMismatchOnOverride.fir.kt index 2a6d3c62012..b9247705e9a 100644 --- a/compiler/testData/diagnostics/tests/annotations/rendering/typeMismatchOnOverride.fir.kt +++ b/compiler/testData/diagnostics/tests/annotations/rendering/typeMismatchOnOverride.fir.kt @@ -17,7 +17,7 @@ interface A { interface B : A { override val p1: Int @An - override val p2: @An String + override val p2: @An String override fun test(arg: String): Int } diff --git a/compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithReceiverToUnitImplicitLiteralsCase.fir.kt b/compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithReceiverToUnitImplicitLiteralsCase.fir.kt index 7f70660d2f6..8105c92d023 100644 --- a/compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithReceiverToUnitImplicitLiteralsCase.fir.kt +++ b/compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithReceiverToUnitImplicitLiteralsCase.fir.kt @@ -30,7 +30,7 @@ fun testYield() { val buildee = build { yield { val x: UserKlass = this@yield } } - checkExactType Unit>>(>; Buildee>")!>buildee) + checkExactType Unit>>(>; Buildee>")!>buildee) } // test 2: PTV is in producing position (materialize-case) @@ -42,5 +42,5 @@ fun testMaterialize() { materialize() ) } - checkExactType Unit>>(>; Buildee>")!>buildee) + checkExactType Unit>>(>; Buildee>")!>buildee) } diff --git a/compiler/testData/diagnostics/tests/j+k/types/notNullTypeParameterWithKotlinNullableWarnings.fir.diag.txt b/compiler/testData/diagnostics/tests/j+k/types/notNullTypeParameterWithKotlinNullableWarnings.fir.diag.txt index da0edb581a8..77313e4dded 100644 --- a/compiler/testData/diagnostics/tests/j+k/types/notNullTypeParameterWithKotlinNullableWarnings.fir.diag.txt +++ b/compiler/testData/diagnostics/tests/j+k/types/notNullTypeParameterWithKotlinNullableWarnings.fir.diag.txt @@ -1,7 +1,7 @@ -/main.kt:(98,103): error: Argument type mismatch: actual type is 'V', but '@EnhancedNullability V & Any' was expected. +/main.kt:(98,103): error: Argument type mismatch: actual type is 'V', but 'V & Any' was expected. -/main.kt:(119,120): error: Argument type mismatch: actual type is 'kotlin/collections/List', but 'ft<@EnhancedNullability kotlin/collections/MutableList<@EnhancedNullability @R|org/jetbrains/annotations/NotNull|() V & Any>, @EnhancedNullability kotlin/collections/List<@EnhancedNullability @R|org/jetbrains/annotations/NotNull|() V & Any>>' was expected. +/main.kt:(119,120): error: Argument type mismatch: actual type is 'kotlin/collections/List', but 'kotlin/collections/(Mutable)List<@NotNull() V & Any>' was expected. -/main.kt:(133,138): error: Argument type mismatch: actual type is 'V', but '@EnhancedNullability E & Any' was expected. +/main.kt:(133,138): error: Argument type mismatch: actual type is 'V', but 'E & Any' was expected. -/main.kt:(154,155): error: Argument type mismatch: actual type is 'kotlin/collections/List', but 'ft<@EnhancedNullability kotlin/collections/MutableList<@EnhancedNullability @R|org/jetbrains/annotations/NotNull|() E & Any>, @EnhancedNullability kotlin/collections/List<@EnhancedNullability @R|org/jetbrains/annotations/NotNull|() E & Any>>' was expected. +/main.kt:(154,155): error: Argument type mismatch: actual type is 'kotlin/collections/List', but 'kotlin/collections/(Mutable)List<@NotNull() E & Any>' was expected.